deps(mobile): flutter 3.16 (#6677)

* dep(mobile): update flutter and deps

* chore: dart analyzer

* chore: update flutter workflow version

* chore: dart format

* fix: gallery_viewer PopScope

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong
2024-01-27 16:14:32 +00:00
committed by GitHub
parent 0522058fdf
commit 27488ceb67
116 changed files with 627 additions and 624 deletions

View File

@@ -11,8 +11,8 @@ import 'package:immich_mobile/shared/ui/immich_loading_indicator.dart';
class AppBarProfileInfoBox extends HookConsumerWidget {
const AppBarProfileInfoBox({
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context, WidgetRef ref) {

View File

@@ -10,8 +10,8 @@ import 'package:package_info_plus/package_info_plus.dart';
class AppBarServerInfo extends HookConsumerWidget {
const AppBarServerInfo({
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context, WidgetRef ref) {

View File

@@ -30,7 +30,7 @@ import 'package:immich_mobile/utils/selection_handlers.dart';
class MultiselectGrid extends HookConsumerWidget {
const MultiselectGrid({
Key? key,
super.key,
required this.renderListProvider,
this.onRefresh,
this.buildLoadingIndicator,
@@ -43,7 +43,7 @@ class MultiselectGrid extends HookConsumerWidget {
this.editEnabled = false,
this.unarchive = false,
this.unfavorite = false,
}) : super(key: key);
});
final ProviderListenable<AsyncValue<RenderList>> renderListProvider;
final Future<void> Function()? onRefresh;

View File

@@ -10,13 +10,13 @@ class ConfirmDialog extends StatelessWidget {
final String ok;
const ConfirmDialog({
Key? key,
super.key,
required this.onOk,
required this.title,
required this.content,
this.cancel = "delete_dialog_cancel",
this.ok = "backup_controller_page_background_battery_info_ok",
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View File

@@ -19,12 +19,12 @@ class CustomDraggingHandle extends StatelessWidget {
class ControlBoxButton extends StatelessWidget {
const ControlBoxButton({
Key? key,
super.key,
required this.label,
required this.iconData,
this.onPressed,
this.onLongPressed,
}) : super(key: key);
});
final String label;
final IconData iconData;

View File

@@ -8,6 +8,7 @@ import 'package:immich_mobile/shared/models/store.dart';
import 'package:immich_mobile/utils/image_url_builder.dart';
import 'package:photo_manager/photo_manager.dart';
import 'package:openapi/api.dart' as api;
import 'package:photo_manager_image_provider/photo_manager_image_provider.dart';
/// Renders an Asset using local data if available, else remote data
class ImmichImage extends StatelessWidget {

View File

@@ -5,9 +5,9 @@ class ImmichLoadingIndicator extends StatelessWidget {
final double? borderRadius;
const ImmichLoadingIndicator({
Key? key,
super.key,
this.borderRadius,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View File

@@ -21,5 +21,4 @@ class ImmichLogo extends StatelessWidget {
),
);
}
}

View File

@@ -233,7 +233,7 @@ class PhotoView extends StatefulWidget {
///
/// Internally, the image is rendered within an [Image] widget.
const PhotoView({
Key? key,
super.key,
required this.imageProvider,
required this.index,
this.loadingBuilder,
@@ -264,8 +264,7 @@ class PhotoView extends StatefulWidget {
this.errorBuilder,
this.enablePanAlways,
}) : child = null,
childSize = null,
super(key: key);
childSize = null;
/// Creates a widget that displays a zoomable child.
///
@@ -274,7 +273,7 @@ class PhotoView extends StatefulWidget {
/// Instead of a [imageProvider], this constructor will receive a [child] and a [childSize].
///
const PhotoView.customChild({
Key? key,
super.key,
required this.child,
this.childSize,
this.backgroundDecoration,
@@ -305,8 +304,7 @@ class PhotoView extends StatefulWidget {
imageProvider = null,
gaplessPlayback = false,
loadingBuilder = null,
index = 0,
super(key: key);
index = 0;
/// Given a [imageProvider] it resolves into an zoomable image widget using. It
/// is required

View File

@@ -107,7 +107,7 @@ typedef PhotoViewGalleryBuilder = PhotoViewGalleryPageOptions Function(
class PhotoViewGallery extends StatefulWidget {
/// Construct a gallery with static items through a list of [PhotoViewGalleryPageOptions].
const PhotoViewGallery({
Key? key,
super.key,
required this.pageOptions,
this.loadingBuilder,
this.backgroundDecoration,
@@ -123,14 +123,13 @@ class PhotoViewGallery extends StatefulWidget {
this.customSize,
this.allowImplicitScrolling = false,
}) : itemCount = null,
builder = null,
super(key: key);
builder = null;
/// Construct a gallery with dynamic items.
///
/// The builder must return a [PhotoViewGalleryPageOptions].
const PhotoViewGallery.builder({
Key? key,
super.key,
required this.itemCount,
required this.builder,
this.loadingBuilder,
@@ -148,8 +147,7 @@ class PhotoViewGallery extends StatefulWidget {
this.allowImplicitScrolling = false,
}) : pageOptions = null,
assert(itemCount != null),
assert(builder != null),
super(key: key);
assert(builder != null);
/// A list of options to describe the items in the gallery
final List<PhotoViewGalleryPageOptions>? pageOptions;

View File

@@ -25,7 +25,7 @@ const _defaultDecoration = BoxDecoration(
/// to user gestures, updates to the controller state and mounts the entire PhotoView Layout
class PhotoViewCore extends StatefulWidget {
const PhotoViewCore({
Key? key,
super.key,
required this.imageProvider,
required this.backgroundDecoration,
required this.gaplessPlayback,
@@ -47,11 +47,10 @@ class PhotoViewCore extends StatefulWidget {
required this.filterQuality,
required this.disableGestures,
required this.enablePanAlways,
}) : customChild = null,
super(key: key);
}) : customChild = null;
const PhotoViewCore.customChild({
Key? key,
super.key,
required this.customChild,
required this.backgroundDecoration,
this.heroAttributes,
@@ -73,8 +72,7 @@ class PhotoViewCore extends StatefulWidget {
required this.disableGestures,
required this.enablePanAlways,
}) : imageProvider = null,
gaplessPlayback = false,
super(key: key);
gaplessPlayback = false;
final Decoration? backgroundDecoration;
final ImageProvider? imageProvider;
@@ -359,15 +357,15 @@ class PhotoViewCoreState extends State<PhotoViewCore>
onScaleStart: onScaleStart,
onScaleUpdate: onScaleUpdate,
onScaleEnd: onScaleEnd,
onDragStart: widget.onDragStart != null
? (details) => widget.onDragStart!(context, details, value)
: null,
onDragEnd: widget.onDragEnd != null
? (details) => widget.onDragEnd!(context, details, value)
: null,
onDragStart: widget.onDragStart != null
? (details) => widget.onDragStart!(context, details, value)
: null,
onDragEnd: widget.onDragEnd != null
? (details) => widget.onDragEnd!(context, details, value)
: null,
onDragUpdate: widget.onDragUpdate != null
? (details) => widget.onDragUpdate!(context, details, value)
: null,
? (details) => widget.onDragUpdate!(context, details, value)
: null,
hitDetector: this,
onTapUp: widget.onTapUp != null
? (details) => widget.onTapUp!(context, details, value)

View File

@@ -7,7 +7,7 @@ import 'photo_view_hit_corners.dart';
/// for the gist
class PhotoViewGestureDetector extends StatelessWidget {
const PhotoViewGestureDetector({
Key? key,
super.key,
this.hitDetector,
this.onScaleStart,
this.onScaleUpdate,
@@ -20,7 +20,7 @@ class PhotoViewGestureDetector extends StatelessWidget {
this.onTapUp,
this.onTapDown,
this.behavior,
}) : super(key: key);
});
final GestureDoubleTapCallback? onDoubleTap;
final HitCornersDetector? hitDetector;
@@ -63,14 +63,14 @@ class PhotoViewGestureDetector extends StatelessWidget {
}
if (onDragStart != null || onDragEnd != null || onDragUpdate != null) {
gestures[VerticalDragGestureRecognizer] =
gestures[VerticalDragGestureRecognizer] =
GestureRecognizerFactoryWithHandlers<VerticalDragGestureRecognizer>(
() => VerticalDragGestureRecognizer(debugOwner: this),
(VerticalDragGestureRecognizer instance) {
instance
..onStart = onDragStart
..onUpdate = onDragUpdate
..onEnd = onDragEnd;
..onStart = onDragStart
..onUpdate = onDragUpdate
..onEnd = onDragEnd;
},
);
}
@@ -86,11 +86,11 @@ class PhotoViewGestureDetector extends StatelessWidget {
gestures[PhotoViewGestureRecognizer] =
GestureRecognizerFactoryWithHandlers<PhotoViewGestureRecognizer>(
() => PhotoViewGestureRecognizer(
hitDetector: hitDetector,
debugOwner: this,
validateAxis: axis,
touchSlopFactor: touchSlopFactor,
),
hitDetector: hitDetector,
debugOwner: this,
validateAxis: axis,
touchSlopFactor: touchSlopFactor,
),
(PhotoViewGestureRecognizer instance) {
instance
..onStart = onScaleStart
@@ -110,11 +110,11 @@ class PhotoViewGestureDetector extends StatelessWidget {
class PhotoViewGestureRecognizer extends ScaleGestureRecognizer {
PhotoViewGestureRecognizer({
this.hitDetector,
Object? debugOwner,
super.debugOwner,
this.validateAxis,
this.touchSlopFactor = 1,
PointerDeviceKind? kind,
}) : super(debugOwner: debugOwner, supportedDevices: null);
}) : super(supportedDevices: null);
final HitCornersDetector? hitDetector;
final Axis? validateAxis;
final double touchSlopFactor;
@@ -236,11 +236,11 @@ class PhotoViewGestureRecognizer extends ScaleGestureRecognizer {
/// ```
class PhotoViewGestureDetectorScope extends InheritedWidget {
const PhotoViewGestureDetectorScope({
super.key,
super.key,
this.axis,
this.touchSlopFactor = .2,
required Widget child,
}) : super(child: child);
required super.child,
});
static PhotoViewGestureDetectorScope? of(BuildContext context) {
final PhotoViewGestureDetectorScope? scope = context
@@ -254,11 +254,12 @@ class PhotoViewGestureDetectorScope extends InheritedWidget {
// 0: most reactive but will not let tap recognizers accept gestures
// <1: less reactive but gives the most leeway to other recognizers
// 1: will not be able to compete with a `HorizontalDragGestureRecognizer` up the widget tree
final double touchSlopFactor;
final double touchSlopFactor;
@override
bool updateShouldNotify(PhotoViewGestureDetectorScope oldWidget) {
return axis != oldWidget.axis && touchSlopFactor != oldWidget.touchSlopFactor;
return axis != oldWidget.axis &&
touchSlopFactor != oldWidget.touchSlopFactor;
}
}
@@ -269,16 +270,14 @@ class PhotoViewGestureDetectorScope extends InheritedWidget {
class PhotoViewPageViewScrollPhysics extends ScrollPhysics {
const PhotoViewPageViewScrollPhysics({
this.touchSlopFactor = 0.1,
ScrollPhysics? parent,
}) : super(parent: parent);
super.parent,
});
// in [0, 1]
// 0: most reactive but will not let PhotoView recognizers accept gestures
// 1: less reactive but gives the most leeway to PhotoView recognizers
final double touchSlopFactor;
@override
PhotoViewPageViewScrollPhysics applyTo(ScrollPhysics? ancestor) {
return PhotoViewPageViewScrollPhysics(
@@ -287,7 +286,6 @@ class PhotoViewPageViewScrollPhysics extends ScrollPhysics {
);
}
@override
double get dragStartDistanceMotionThreshold => kTouchSlop * touchSlopFactor;
}

View File

@@ -26,7 +26,11 @@ mixin HitCornersDetector on PhotoViewControllerDelegate {
return HitCorners(y <= cornersY.min, y >= cornersY.max);
}
bool _shouldMoveAxis(HitCorners hitCorners, double mainAxisMove, double crossAxisMove) {
bool _shouldMoveAxis(
HitCorners hitCorners,
double mainAxisMove,
double crossAxisMove,
) {
if (mainAxisMove == 0) {
return false;
}

View File

@@ -1,8 +1,7 @@
import 'package:flutter/material.dart';
class PhotoViewDefaultError extends StatelessWidget {
const PhotoViewDefaultError({Key? key, required this.decoration})
: super(key: key);
const PhotoViewDefaultError({super.key, required this.decoration});
final BoxDecoration decoration;
@@ -22,7 +21,7 @@ class PhotoViewDefaultError extends StatelessWidget {
}
class PhotoViewDefaultLoading extends StatelessWidget {
const PhotoViewDefaultLoading({Key? key, this.event}) : super(key: key);
const PhotoViewDefaultLoading({super.key, this.event});
final ImageChunkEvent? event;

View File

@@ -7,7 +7,7 @@ import 'utils/photo_view_utils.dart';
class ImageWrapper extends StatefulWidget {
const ImageWrapper({
Key? key,
super.key,
required this.imageProvider,
required this.loadingBuilder,
required this.backgroundDecoration,
@@ -36,7 +36,7 @@ class ImageWrapper extends StatefulWidget {
required this.errorBuilder,
required this.enablePanAlways,
required this.index,
}) : super(key: key);
});
final ImageProvider imageProvider;
final LoadingBuilder? loadingBuilder;
@@ -237,7 +237,7 @@ class _ImageWrapperState extends State<ImageWrapper> {
class CustomChildWrapper extends StatelessWidget {
const CustomChildWrapper({
Key? key,
super.key,
this.child,
required this.childSize,
required this.backgroundDecoration,
@@ -263,7 +263,7 @@ class CustomChildWrapper extends StatelessWidget {
required this.filterQuality,
required this.disableGestures,
required this.enablePanAlways,
}) : super(key: key);
});
final Widget? child;
final Size? childSize;

View File

@@ -17,7 +17,7 @@ double getScaleForScaleState(
case PhotoViewScaleState.covering:
return _clampSize(
_scaleForCovering(
scaleBoundaries.outerSize,
scaleBoundaries.outerSize,
scaleBoundaries.childSize,
),
scaleBoundaries,

View File

@@ -2,7 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
class ShareDialog extends StatelessWidget {
const ShareDialog({Key? key}) : super(key: key);
const ShareDialog({super.key});
@override
Widget build(BuildContext context) {
@@ -13,8 +13,7 @@ class ShareDialog extends StatelessWidget {
const CircularProgressIndicator(),
Container(
margin: const EdgeInsets.only(top: 12),
child: const Text('share_dialog_preparing')
.tr(),
child: const Text('share_dialog_preparing').tr(),
),
],
),