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
@@ -14,7 +14,7 @@ class AssetDescriptionNotifier extends StateNotifier<String> {
AssetDescriptionNotifier(
this._db,
this._service,
this._service,
this._asset,
) : super('') {
_fetchLocalDescription();
@@ -34,9 +34,7 @@ class AssetDescriptionNotifier extends StateNotifier<String> {
}
// Subscribe to local changes
final exifInfo = await _db
.exifInfos
.get(localExifId);
final exifInfo = await _db.exifInfos.get(localExifId);
// Guard
if (exifInfo?.description == null) {
@@ -75,13 +73,11 @@ class AssetDescriptionNotifier extends StateNotifier<String> {
return;
}
return _service
.setDescription(description, remoteAssetId, localExifId);
return _service.setDescription(description, remoteAssetId, localExifId);
}
}
final assetDescriptionProvider = StateNotifierProvider
.autoDispose
final assetDescriptionProvider = StateNotifierProvider.autoDispose
.family<AssetDescriptionNotifier, String, Asset>(
(ref, asset) => AssetDescriptionNotifier(
ref.watch(dbProvider),
@@ -89,5 +85,3 @@ final assetDescriptionProvider = StateNotifierProvider
asset,
),
);
@@ -24,11 +24,13 @@ class ImageViewerService {
try {
// Download LivePhotos image and motion part
if (asset.isImage && asset.livePhotoVideoId != null && Platform.isIOS) {
var imageResponse = await _apiService.assetApi.downloadFileOldWithHttpInfo(
var imageResponse =
await _apiService.assetApi.downloadFileOldWithHttpInfo(
asset.remoteId!,
);
var motionReponse = await _apiService.assetApi.downloadFileOldWithHttpInfo(
var motionReponse =
await _apiService.assetApi.downloadFileOldWithHttpInfo(
asset.livePhotoVideoId!,
);
@@ -7,8 +7,7 @@ import 'package:immich_mobile/shared/models/asset.dart';
class AdvancedBottomSheet extends HookConsumerWidget {
final Asset assetDetail;
const AdvancedBottomSheet({Key? key, required this.assetDetail})
: super(key: key);
const AdvancedBottomSheet({super.key, required this.assetDetail});
@override
Widget build(BuildContext context, WidgetRef ref) {
@@ -3,11 +3,11 @@ import 'package:flutter/material.dart';
/// A widget that animates implicitly between a play and a pause icon.
class AnimatedPlayPause extends StatefulWidget {
const AnimatedPlayPause({
Key? key,
super.key,
required this.playing,
this.size,
this.color,
}) : super(key: key);
});
final double? size;
final bool playing;
@@ -3,14 +3,14 @@ import 'package:immich_mobile/modules/asset_viewer/ui/animated_play_pause.dart';
class CenterPlayButton extends StatelessWidget {
const CenterPlayButton({
Key? key,
super.key,
required this.backgroundColor,
this.iconColor,
required this.show,
required this.isPlaying,
required this.isFinished,
this.onPressed,
}) : super(key: key);
});
final Color backgroundColor;
final Color? iconColor;
@@ -19,7 +19,7 @@ import 'package:url_launcher/url_launcher.dart';
class ExifBottomSheet extends HookConsumerWidget {
final Asset asset;
const ExifBottomSheet({Key? key, required this.asset}) : super(key: key);
const ExifBottomSheet({super.key, required this.asset});
@override
Widget build(BuildContext context, WidgetRef ref) {
@@ -8,7 +8,7 @@ import 'package:immich_mobile/shared/providers/asset.provider.dart';
class TopControlAppBar extends HookConsumerWidget {
const TopControlAppBar({
Key? key,
super.key,
required this.asset,
required this.onMoreInfoPressed,
required this.onDownloadPressed,
@@ -20,7 +20,7 @@ class TopControlAppBar extends HookConsumerWidget {
required this.isOwner,
required this.onActivitiesPressed,
required this.isPartner,
}) : super(key: key);
});
final Asset asset;
final Function onMoreInfoPressed;
@@ -12,8 +12,8 @@ import 'package:video_player/video_player.dart';
class VideoPlayerControls extends ConsumerStatefulWidget {
const VideoPlayerControls({
Key? key,
}) : super(key: key);
super.key,
});
@override
VideoPlayerControlsState createState() => VideoPlayerControlsState();
@@ -751,15 +751,16 @@ class GalleryViewerPage extends HookConsumerWidget {
}
});
return Scaffold(
backgroundColor: Colors.black,
body: WillPopScope(
onWillPop: () async {
// Change immersive mode back to normal "edgeToEdge" mode
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
return true;
},
child: Stack(
return PopScope(
canPop: false,
onPopInvoked: (_) {
// Change immersive mode back to normal "edgeToEdge" mode
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
context.pop();
},
child: Scaffold(
backgroundColor: Colors.black,
body: Stack(
children: [
PhotoViewGallery.builder(
scaleStateChangedCallback: (state) {
@@ -26,14 +26,14 @@ class VideoViewerPage extends HookConsumerWidget {
final VoidCallback? onPaused;
const VideoViewerPage({
Key? key,
super.key,
required this.asset,
required this.isMotionVideo,
required this.onVideoEnded,
this.onPlaying,
this.onPaused,
this.placeholder,
}) : super(key: key);
});
@override
Widget build(BuildContext context, WidgetRef ref) {
@@ -112,7 +112,7 @@ class VideoPlayer extends StatefulWidget {
final Widget? placeholder;
const VideoPlayer({
Key? key,
super.key,
this.url,
this.jwtToken,
this.file,
@@ -121,7 +121,7 @@ class VideoPlayer extends StatefulWidget {
this.onPlaying,
this.onPaused,
this.placeholder,
}) : super(key: key);
});
@override
State<VideoPlayer> createState() => _VideoPlayerState();