1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-27 22:22:45 +01:00

deps(mobile): update dependency auto_route to v8 ()

deps: update dependency auto_route to v8

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
shenlong 2024-05-14 19:07:31 +00:00 committed by GitHub
parent 72b1d582ba
commit 6c008176c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 275 additions and 363 deletions

View file

@ -54,7 +54,7 @@ class AlbumPreviewPage extends HookConsumerWidget {
], ],
), ),
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_new_rounded), icon: const Icon(Icons.arrow_back_ios_new_rounded),
), ),
), ),

View file

@ -191,7 +191,7 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_rounded), icon: const Icon(Icons.arrow_back_ios_rounded),
), ),
title: const Text( title: const Text(

View file

@ -7,16 +7,16 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/extensions/build_context_extensions.dart'; import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/models/backup/backup_state.model.dart';
import 'package:immich_mobile/providers/album/album.provider.dart'; import 'package:immich_mobile/providers/album/album.provider.dart';
import 'package:immich_mobile/providers/backup/backup.provider.dart';
import 'package:immich_mobile/providers/backup/error_backup_list.provider.dart'; import 'package:immich_mobile/providers/backup/error_backup_list.provider.dart';
import 'package:immich_mobile/providers/backup/ios_background_settings.provider.dart'; import 'package:immich_mobile/providers/backup/ios_background_settings.provider.dart';
import 'package:immich_mobile/providers/backup/manual_upload.provider.dart'; import 'package:immich_mobile/providers/backup/manual_upload.provider.dart';
import 'package:immich_mobile/widgets/backup/current_backup_asset_info_box.dart';
import 'package:immich_mobile/models/backup/backup_state.model.dart';
import 'package:immich_mobile/providers/backup/backup.provider.dart';
import 'package:immich_mobile/routing/router.dart';
import 'package:immich_mobile/providers/websocket.provider.dart'; import 'package:immich_mobile/providers/websocket.provider.dart';
import 'package:immich_mobile/routing/router.dart';
import 'package:immich_mobile/widgets/backup/backup_info_card.dart'; import 'package:immich_mobile/widgets/backup/backup_info_card.dart';
import 'package:immich_mobile/widgets/backup/current_backup_asset_info_box.dart';
@RoutePage() @RoutePage()
class BackupControllerPage extends HookConsumerWidget { class BackupControllerPage extends HookConsumerWidget {
@ -260,7 +260,7 @@ class BackupControllerPage extends HookConsumerWidget {
leading: IconButton( leading: IconButton(
onPressed: () { onPressed: () {
ref.watch(websocketProvider.notifier).listenUploadEvent(); ref.watch(websocketProvider.notifier).listenUploadEvent();
context.popRoute(true); context.maybePop(true);
}, },
splashRadius: 24, splashRadius: 24,
icon: const Icon( icon: const Icon(

View file

@ -13,7 +13,7 @@ class BackupOptionsPage extends StatelessWidget {
elevation: 0, elevation: 0,
title: const Text("backup_options_page_title").tr(), title: const Text("backup_options_page_title").tr(),
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(true), onPressed: () => context.maybePop(true),
splashRadius: 24, splashRadius: 24,
icon: const Icon( icon: const Icon(
Icons.arrow_back_ios_rounded, Icons.arrow_back_ios_rounded,

View file

@ -23,7 +23,7 @@ class FailedBackupStatusPage extends HookConsumerWidget {
), ),
leading: IconButton( leading: IconButton(
onPressed: () { onPressed: () {
context.popRoute(true); context.maybePop(true);
}, },
splashRadius: 24, splashRadius: 24,
icon: const Icon( icon: const Icon(

View file

@ -26,7 +26,7 @@ class AlbumAdditionalSharedUserSelectionPage extends HookConsumerWidget {
final sharedUsersList = useState<Set<User>>({}); final sharedUsersList = useState<Set<User>>({});
addNewUsersHandler() { addNewUsersHandler() {
context.popRoute(sharedUsersList.value.map((e) => e.id).toList()); context.maybePop(sharedUsersList.value.map((e) => e.id).toList());
} }
buildTileIcon(User user) { buildTileIcon(User user) {
@ -127,7 +127,7 @@ class AlbumAdditionalSharedUserSelectionPage extends HookConsumerWidget {
leading: IconButton( leading: IconButton(
icon: const Icon(Icons.close_rounded), icon: const Icon(Icons.close_rounded),
onPressed: () { onPressed: () {
context.popRoute(null); context.maybePop(null);
}, },
), ),
actions: [ actions: [

View file

@ -184,7 +184,7 @@ class AlbumOptionsPage extends HookConsumerWidget {
appBar: AppBar( appBar: AppBar(
leading: IconButton( leading: IconButton(
icon: const Icon(Icons.arrow_back_ios_new_rounded), icon: const Icon(Icons.arrow_back_ios_new_rounded),
onPressed: () => context.popRoute(null), onPressed: () => context.maybePop(null),
), ),
centerTitle: true, centerTitle: true,
title: Text("translated_text_options".tr()), title: Text("translated_text_options".tr()),

View file

@ -36,7 +36,7 @@ class AlbumSharedUserSelectionPage extends HookConsumerWidget {
await ref.watch(sharedAlbumProvider.notifier).getAllSharedAlbums(); await ref.watch(sharedAlbumProvider.notifier).getAllSharedAlbums();
// ref.watch(assetSelectionProvider.notifier).removeAll(); // ref.watch(assetSelectionProvider.notifier).removeAll();
ref.watch(albumTitleProvider.notifier).clearAlbumTitle(); ref.watch(albumTitleProvider.notifier).clearAlbumTitle();
context.popRoute(true); context.maybePop(true);
context context
.navigateTo(const TabControllerRoute(children: [SharingRoute()])); .navigateTo(const TabControllerRoute(children: [SharingRoute()]));
} }
@ -152,7 +152,7 @@ class AlbumSharedUserSelectionPage extends HookConsumerWidget {
leading: IconButton( leading: IconButton(
icon: const Icon(Icons.close_rounded), icon: const Icon(Icons.close_rounded),
onPressed: () async { onPressed: () async {
context.popRoute(); context.maybePop();
}, },
), ),
actions: [ actions: [

View file

@ -105,7 +105,7 @@ class AppLogPage extends HookConsumerWidget {
], ],
leading: IconButton( leading: IconButton(
onPressed: () { onPressed: () {
context.popRoute(); context.maybePop();
}, },
icon: const Icon( icon: const Icon(
Icons.arrow_back_ios_new_rounded, Icons.arrow_back_ios_new_rounded,

View file

@ -3,16 +3,16 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/extensions/build_context_extensions.dart'; import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/models/albums/asset_selection_page_result.model.dart'; import 'package:immich_mobile/models/albums/asset_selection_page_result.model.dart';
import 'package:immich_mobile/providers/album/album.provider.dart'; import 'package:immich_mobile/providers/album/album.provider.dart';
import 'package:immich_mobile/providers/album/album_title.provider.dart'; import 'package:immich_mobile/providers/album/album_title.provider.dart';
import 'package:immich_mobile/providers/asset.provider.dart';
import 'package:immich_mobile/routing/router.dart';
import 'package:immich_mobile/widgets/album/album_action_outlined_button.dart'; import 'package:immich_mobile/widgets/album/album_action_outlined_button.dart';
import 'package:immich_mobile/widgets/album/album_title_text_field.dart'; import 'package:immich_mobile/widgets/album/album_title_text_field.dart';
import 'package:immich_mobile/widgets/album/shared_album_thumbnail_image.dart'; import 'package:immich_mobile/widgets/album/shared_album_thumbnail_image.dart';
import 'package:immich_mobile/routing/router.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/providers/asset.provider.dart';
@RoutePage() @RoutePage()
// ignore: must_be_immutable // ignore: must_be_immutable
@ -216,7 +216,7 @@ class CreateAlbumPage extends HookConsumerWidget {
leading: IconButton( leading: IconButton(
onPressed: () { onPressed: () {
selectedAssets.value = {}; selectedAssets.value = {};
context.popRoute(); context.maybePop();
}, },
icon: const Icon(Icons.close_rounded), icon: const Icon(Icons.close_rounded),
), ),

View file

@ -2,32 +2,33 @@ import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'dart:math'; import 'dart:math';
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'package:auto_route/auto_route.dart'; import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart' hide Store; import 'package:flutter_hooks/flutter_hooks.dart' hide Store;
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/extensions/build_context_extensions.dart'; import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/providers/image/immich_remote_image_provider.dart'; import 'package:immich_mobile/pages/common/video_viewer.page.dart';
import 'package:immich_mobile/providers/app_settings.provider.dart';
import 'package:immich_mobile/providers/asset_viewer/asset_stack.provider.dart'; import 'package:immich_mobile/providers/asset_viewer/asset_stack.provider.dart';
import 'package:immich_mobile/providers/asset_viewer/current_asset.provider.dart'; import 'package:immich_mobile/providers/asset_viewer/current_asset.provider.dart';
import 'package:immich_mobile/providers/asset_viewer/show_controls.provider.dart'; import 'package:immich_mobile/providers/asset_viewer/show_controls.provider.dart';
import 'package:immich_mobile/providers/asset_viewer/video_player_value_provider.dart'; import 'package:immich_mobile/providers/asset_viewer/video_player_value_provider.dart';
import 'package:immich_mobile/providers/haptic_feedback.provider.dart';
import 'package:immich_mobile/providers/image/immich_remote_image_provider.dart';
import 'package:immich_mobile/services/app_settings.service.dart';
import 'package:immich_mobile/widgets/asset_viewer/advanced_bottom_sheet.dart'; import 'package:immich_mobile/widgets/asset_viewer/advanced_bottom_sheet.dart';
import 'package:immich_mobile/widgets/asset_viewer/bottom_gallery_bar.dart'; import 'package:immich_mobile/widgets/asset_viewer/bottom_gallery_bar.dart';
import 'package:immich_mobile/widgets/asset_viewer/exif_sheet/exif_bottom_sheet.dart'; import 'package:immich_mobile/widgets/asset_viewer/exif_sheet/exif_bottom_sheet.dart';
import 'package:immich_mobile/widgets/asset_viewer/gallery_app_bar.dart'; import 'package:immich_mobile/widgets/asset_viewer/gallery_app_bar.dart';
import 'package:immich_mobile/providers/app_settings.provider.dart';
import 'package:immich_mobile/pages/common/video_viewer.page.dart';
import 'package:immich_mobile/services/app_settings.service.dart';
import 'package:immich_mobile/providers/haptic_feedback.provider.dart';
import 'package:immich_mobile/widgets/common/immich_image.dart'; import 'package:immich_mobile/widgets/common/immich_image.dart';
import 'package:immich_mobile/widgets/common/immich_thumbnail.dart'; import 'package:immich_mobile/widgets/common/immich_thumbnail.dart';
import 'package:immich_mobile/widgets/photo_view/photo_view_gallery.dart'; import 'package:immich_mobile/widgets/photo_view/photo_view_gallery.dart';
import 'package:immich_mobile/widgets/photo_view/src/photo_view_computed_scale.dart'; import 'package:immich_mobile/widgets/photo_view/src/photo_view_computed_scale.dart';
import 'package:immich_mobile/widgets/photo_view/src/photo_view_scale_state.dart'; import 'package:immich_mobile/widgets/photo_view/src/photo_view_scale_state.dart';
import 'package:immich_mobile/widgets/photo_view/src/utils/photo_view_hero_attributes.dart'; import 'package:immich_mobile/widgets/photo_view/src/utils/photo_view_hero_attributes.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:isar/isar.dart'; import 'package:isar/isar.dart';
import 'package:openapi/api.dart' show ThumbnailFormat; import 'package:openapi/api.dart' show ThumbnailFormat;
@ -174,7 +175,7 @@ class GalleryViewerPage extends HookConsumerWidget {
final ratio = d.dy / max(d.dx.abs(), 1); final ratio = d.dy / max(d.dx.abs(), 1);
if (d.dy > sensitivity && ratio > ratioThreshold) { if (d.dy > sensitivity && ratio > ratioThreshold) {
context.popRoute(); context.maybePop();
} else if (d.dy < -sensitivity && ratio < -ratioThreshold) { } else if (d.dy < -sensitivity && ratio < -ratioThreshold) {
showInfo(); showInfo();
} }
@ -261,12 +262,9 @@ class GalleryViewerPage extends HookConsumerWidget {
} }
return PopScope( return PopScope(
canPop: false, // Change immersive mode back to normal "edgeToEdge" mode
onPopInvoked: (_) { onPopInvoked: (_) =>
// Change immersive mode back to normal "edgeToEdge" mode SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge),
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
context.pop();
},
child: Scaffold( child: Scaffold(
backgroundColor: Colors.black, backgroundColor: Colors.black,
body: Stack( body: Stack(

View file

@ -1,18 +1,15 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/providers/asset_viewer/show_controls.provider.dart'; import 'package:immich_mobile/providers/asset_viewer/show_controls.provider.dart';
import 'package:immich_mobile/providers/asset_viewer/video_player_controller_provider.dart'; import 'package:immich_mobile/providers/asset_viewer/video_player_controller_provider.dart';
import 'package:immich_mobile/providers/asset_viewer/video_player_controls_provider.dart'; import 'package:immich_mobile/providers/asset_viewer/video_player_controls_provider.dart';
import 'package:immich_mobile/providers/asset_viewer/video_player_value_provider.dart'; import 'package:immich_mobile/providers/asset_viewer/video_player_value_provider.dart';
import 'package:immich_mobile/widgets/asset_viewer/video_player.dart'; import 'package:immich_mobile/widgets/asset_viewer/video_player.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/widgets/common/delayed_loading_indicator.dart'; import 'package:immich_mobile/widgets/common/delayed_loading_indicator.dart';
import 'package:wakelock_plus/wakelock_plus.dart'; import 'package:wakelock_plus/wakelock_plus.dart';
@RoutePage()
// ignore: must_be_immutable
class VideoViewerPage extends HookConsumerWidget { class VideoViewerPage extends HookConsumerWidget {
final Asset asset; final Asset asset;
final bool isMotionVideo; final bool isMotionVideo;

View file

@ -17,7 +17,7 @@ class ArchivePage extends HookConsumerWidget {
final count = archivedAssets.value?.totalAssets.toString() ?? "?"; final count = archivedAssets.value?.totalAssets.toString() ?? "?";
return AppBar( return AppBar(
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_rounded), icon: const Icon(Icons.arrow_back_ios_rounded),
), ),
centerTitle: true, centerTitle: true,

View file

@ -15,7 +15,7 @@ class FavoritesPage extends HookConsumerWidget {
AppBar buildAppBar() { AppBar buildAppBar() {
return AppBar( return AppBar(
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_rounded), icon: const Icon(Icons.arrow_back_ios_rounded),
), ),
centerTitle: true, centerTitle: true,

View file

@ -143,7 +143,7 @@ class TrashPage extends HookConsumerWidget {
return AppBar( return AppBar(
leading: IconButton( leading: IconButton(
onPressed: !selectionEnabledHook.value onPressed: !selectionEnabledHook.value
? () => context.popRoute() ? () => context.maybePop()
: () { : () {
selectionEnabledHook.value = false; selectionEnabledHook.value = false;
selection.value = {}; selection.value = {};

View file

@ -176,7 +176,7 @@ class PermissionOnboardingPage extends HookConsumerWidget {
), ),
TextButton( TextButton(
child: const Text('permission_onboarding_back').tr(), child: const Text('permission_onboarding_back').tr(),
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
), ),
], ],
), ),

View file

@ -3,14 +3,14 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/models/memories/memory.model.dart'; import 'package:immich_mobile/models/memories/memory.model.dart';
import 'package:immich_mobile/providers/haptic_feedback.provider.dart';
import 'package:immich_mobile/widgets/common/immich_image.dart';
import 'package:immich_mobile/widgets/memories/memory_bottom_info.dart'; import 'package:immich_mobile/widgets/memories/memory_bottom_info.dart';
import 'package:immich_mobile/widgets/memories/memory_card.dart'; import 'package:immich_mobile/widgets/memories/memory_card.dart';
import 'package:immich_mobile/widgets/memories/memory_epilogue.dart'; import 'package:immich_mobile/widgets/memories/memory_epilogue.dart';
import 'package:immich_mobile/widgets/memories/memory_progress_indicator.dart'; import 'package:immich_mobile/widgets/memories/memory_progress_indicator.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/providers/haptic_feedback.provider.dart';
import 'package:immich_mobile/widgets/common/immich_image.dart';
@RoutePage() @RoutePage()
class MemoryPage extends HookConsumerWidget { class MemoryPage extends HookConsumerWidget {
@ -153,7 +153,7 @@ class MemoryPage extends HookConsumerWidget {
final offset = notification.metrics.pixels; final offset = notification.metrics.pixels;
if (isEpiloguePage && if (isEpiloguePage &&
(offset > notification.metrics.maxScrollExtent + 150)) { (offset > notification.metrics.maxScrollExtent + 150)) {
context.popRoute(); context.maybePop();
return true; return true;
} }
} }
@ -256,7 +256,7 @@ class MemoryPage extends HookConsumerWidget {
// auto_route doesn't invoke pop scope, so // auto_route doesn't invoke pop scope, so
// turn off full screen mode here // turn off full screen mode here
// https://github.com/Milad-Akarie/auto_route_library/issues/1799 // https://github.com/Milad-Akarie/auto_route_library/issues/1799
context.popRoute(); context.maybePop();
SystemChrome.setEnabledSystemUIMode( SystemChrome.setEnabledSystemUIMode(
SystemUiMode.edgeToEdge, SystemUiMode.edgeToEdge,
); );

View file

@ -18,7 +18,7 @@ class AllMotionPhotosPage extends HookConsumerWidget {
appBar: AppBar( appBar: AppBar(
title: const Text('motion_photos_page_title').tr(), title: const Text('motion_photos_page_title').tr(),
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_rounded), icon: const Icon(Icons.arrow_back_ios_rounded),
), ),
), ),

View file

@ -21,7 +21,7 @@ class AllPeoplePage extends HookConsumerWidget {
'all_people_page_title', 'all_people_page_title',
).tr(), ).tr(),
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_rounded), icon: const Icon(Icons.arrow_back_ios_rounded),
), ),
), ),

View file

@ -22,7 +22,7 @@ class AllPlacesPage extends HookConsumerWidget {
'curated_location_page_title', 'curated_location_page_title',
).tr(), ).tr(),
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_rounded), icon: const Icon(Icons.arrow_back_ios_rounded),
), ),
), ),

View file

@ -15,7 +15,7 @@ class AllVideosPage extends HookConsumerWidget {
appBar: AppBar( appBar: AppBar(
title: const Text('all_videos_page_title').tr(), title: const Text('all_videos_page_title').tr(),
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_rounded), icon: const Icon(Icons.arrow_back_ios_rounded),
), ),
), ),

View file

@ -41,7 +41,7 @@ class MapLocationPickerPage extends HookConsumerWidget {
} }
void onClose([LatLng? selected]) { void onClose([LatLng? selected]) {
context.popRoute(selected); context.maybePop(selected);
} }
Future<void> getCurrentLocation() async { Future<void> getCurrentLocation() async {

View file

@ -102,7 +102,7 @@ class PersonResultPage extends HookConsumerWidget {
appBar: AppBar( appBar: AppBar(
title: Text(name.value), title: Text(name.value),
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_rounded), icon: const Icon(Icons.arrow_back_ios_rounded),
), ),
actions: [ actions: [

View file

@ -18,7 +18,7 @@ class RecentlyAddedPage extends HookConsumerWidget {
appBar: AppBar( appBar: AppBar(
title: const Text('recently_added_page_title').tr(), title: const Text('recently_added_page_title').tr(),
leading: IconButton( leading: IconButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_rounded), icon: const Icon(Icons.arrow_back_ios_rounded),
), ),
), ),

View file

@ -4,9 +4,11 @@ import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/extensions/build_context_extensions.dart'; import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/models/search/search_filter.model.dart'; import 'package:immich_mobile/models/search/search_filter.model.dart';
import 'package:immich_mobile/providers/search/paginated_search.provider.dart'; import 'package:immich_mobile/providers/search/paginated_search.provider.dart';
import 'package:immich_mobile/widgets/asset_grid/multiselect_grid.dart';
import 'package:immich_mobile/widgets/search/search_filter/camera_picker.dart'; import 'package:immich_mobile/widgets/search/search_filter/camera_picker.dart';
import 'package:immich_mobile/widgets/search/search_filter/display_option_picker.dart'; import 'package:immich_mobile/widgets/search/search_filter/display_option_picker.dart';
import 'package:immich_mobile/widgets/search/search_filter/filter_bottom_sheet_scaffold.dart'; import 'package:immich_mobile/widgets/search/search_filter/filter_bottom_sheet_scaffold.dart';
@ -15,8 +17,6 @@ import 'package:immich_mobile/widgets/search/search_filter/media_type_picker.dar
import 'package:immich_mobile/widgets/search/search_filter/people_picker.dart'; import 'package:immich_mobile/widgets/search/search_filter/people_picker.dart';
import 'package:immich_mobile/widgets/search/search_filter/search_filter_chip.dart'; import 'package:immich_mobile/widgets/search/search_filter/search_filter_chip.dart';
import 'package:immich_mobile/widgets/search/search_filter/search_filter_utils.dart'; import 'package:immich_mobile/widgets/search/search_filter/search_filter_utils.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/widgets/asset_grid/multiselect_grid.dart';
import 'package:openapi/api.dart'; import 'package:openapi/api.dart';
@RoutePage() @RoutePage()
@ -480,9 +480,7 @@ class SearchInputPage extends HookConsumerWidget {
], ],
leading: IconButton( leading: IconButton(
icon: const Icon(Icons.arrow_back_ios_new_rounded), icon: const Icon(Icons.arrow_back_ios_new_rounded),
onPressed: () { onPressed: () => context.router.maybePop(),
context.router.pop();
},
), ),
title: TextField( title: TextField(
controller: textSearchController, controller: textSearchController,

View file

@ -328,7 +328,7 @@ class SharedLinkEditPage extends HookConsumerWidget {
alignment: Alignment.bottomRight, alignment: Alignment.bottomRight,
child: ElevatedButton( child: ElevatedButton(
onPressed: () { onPressed: () {
context.popRoute(); context.maybePop();
}, },
child: const Text( child: const Text(
"share_done", "share_done",
@ -431,7 +431,7 @@ class SharedLinkEditPage extends HookConsumerWidget {
changeExpiry: changeExpiry, changeExpiry: changeExpiry,
); );
ref.invalidate(sharedLinksStateProvider); ref.invalidate(sharedLinksStateProvider);
context.popRoute(); context.maybePop();
} }
return Scaffold( return Scaffold(

View file

@ -1,35 +1,32 @@
import 'package:auto_route/auto_route.dart'; import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/models/memories/memory.model.dart';
import 'package:immich_mobile/models/search/search_filter.model.dart';
import 'package:immich_mobile/pages/common/activities.page.dart';
import 'package:immich_mobile/models/albums/asset_selection_page_result.model.dart';
import 'package:immich_mobile/pages/common/album_options.page.dart';
import 'package:immich_mobile/pages/common/album_viewer.page.dart';
import 'package:immich_mobile/pages/common/album_asset_selection.page.dart';
import 'package:immich_mobile/pages/common/create_album.page.dart';
import 'package:immich_mobile/models/shared_link/shared_link.model.dart';
import 'package:immich_mobile/pages/common/album_additional_shared_user_selection.page.dart';
import 'package:immich_mobile/pages/common/album_shared_user_selection.page.dart';
import 'package:immich_mobile/providers/gallery_permission.provider.dart';
import 'package:immich_mobile/routing/auth_guard.dart';
import 'package:immich_mobile/routing/custom_transition_builders.dart';
import 'package:immich_mobile/routing/duplicate_guard.dart';
import 'package:immich_mobile/routing/backup_permission_guard.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/entities/album.entity.dart'; import 'package:immich_mobile/entities/album.entity.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/entities/logger_message.entity.dart'; import 'package:immich_mobile/entities/logger_message.entity.dart';
import 'package:immich_mobile/entities/user.entity.dart'; import 'package:immich_mobile/entities/user.entity.dart';
import 'package:immich_mobile/providers/api.provider.dart'; import 'package:immich_mobile/models/albums/asset_selection_page_result.model.dart';
import 'package:immich_mobile/pages/common/app_log_detail.page.dart'; import 'package:immich_mobile/models/memories/memory.model.dart';
import 'package:immich_mobile/pages/common/app_log.page.dart'; import 'package:immich_mobile/models/search/search_filter.model.dart';
import 'package:immich_mobile/models/shared_link/shared_link.model.dart';
import 'package:immich_mobile/pages/backup/album_preview.page.dart'; import 'package:immich_mobile/pages/backup/album_preview.page.dart';
import 'package:immich_mobile/pages/backup/backup_album_selection.page.dart'; import 'package:immich_mobile/pages/backup/backup_album_selection.page.dart';
import 'package:immich_mobile/pages/backup/backup_controller.page.dart'; import 'package:immich_mobile/pages/backup/backup_controller.page.dart';
import 'package:immich_mobile/pages/backup/backup_options.page.dart'; import 'package:immich_mobile/pages/backup/backup_options.page.dart';
import 'package:immich_mobile/pages/backup/failed_backup_status.page.dart'; import 'package:immich_mobile/pages/backup/failed_backup_status.page.dart';
import 'package:immich_mobile/pages/common/activities.page.dart';
import 'package:immich_mobile/pages/common/album_additional_shared_user_selection.page.dart';
import 'package:immich_mobile/pages/common/album_asset_selection.page.dart';
import 'package:immich_mobile/pages/common/album_options.page.dart';
import 'package:immich_mobile/pages/common/album_shared_user_selection.page.dart';
import 'package:immich_mobile/pages/common/album_viewer.page.dart';
import 'package:immich_mobile/pages/common/app_log.page.dart';
import 'package:immich_mobile/pages/common/app_log_detail.page.dart';
import 'package:immich_mobile/pages/common/create_album.page.dart';
import 'package:immich_mobile/pages/common/gallery_viewer.page.dart'; import 'package:immich_mobile/pages/common/gallery_viewer.page.dart';
import 'package:immich_mobile/pages/common/settings.page.dart';
import 'package:immich_mobile/pages/common/splash_screen.page.dart';
import 'package:immich_mobile/pages/common/tab_controller.page.dart';
import 'package:immich_mobile/pages/library/archive.page.dart'; import 'package:immich_mobile/pages/library/archive.page.dart';
import 'package:immich_mobile/pages/library/favorite.page.dart'; import 'package:immich_mobile/pages/library/favorite.page.dart';
import 'package:immich_mobile/pages/library/library.page.dart'; import 'package:immich_mobile/pages/library/library.page.dart';
@ -43,21 +40,23 @@ import 'package:immich_mobile/pages/search/all_motion_videos.page.dart';
import 'package:immich_mobile/pages/search/all_people.page.dart'; import 'package:immich_mobile/pages/search/all_people.page.dart';
import 'package:immich_mobile/pages/search/all_places.page.dart'; import 'package:immich_mobile/pages/search/all_places.page.dart';
import 'package:immich_mobile/pages/search/all_videos.page.dart'; import 'package:immich_mobile/pages/search/all_videos.page.dart';
import 'package:immich_mobile/pages/search/map/map_location_picker.page.dart';
import 'package:immich_mobile/pages/search/map/map.page.dart'; import 'package:immich_mobile/pages/search/map/map.page.dart';
import 'package:immich_mobile/pages/search/map/map_location_picker.page.dart';
import 'package:immich_mobile/pages/search/person_result.page.dart'; import 'package:immich_mobile/pages/search/person_result.page.dart';
import 'package:immich_mobile/pages/search/recently_added.page.dart'; import 'package:immich_mobile/pages/search/recently_added.page.dart';
import 'package:immich_mobile/pages/search/search_input.page.dart';
import 'package:immich_mobile/pages/search/search.page.dart'; import 'package:immich_mobile/pages/search/search.page.dart';
import 'package:immich_mobile/pages/common/settings.page.dart'; import 'package:immich_mobile/pages/search/search_input.page.dart';
import 'package:immich_mobile/pages/sharing/partner/partner_detail.page.dart';
import 'package:immich_mobile/pages/sharing/partner/partner.page.dart'; import 'package:immich_mobile/pages/sharing/partner/partner.page.dart';
import 'package:immich_mobile/pages/sharing/shared_link/shared_link_edit.page.dart'; import 'package:immich_mobile/pages/sharing/partner/partner_detail.page.dart';
import 'package:immich_mobile/pages/sharing/shared_link/shared_link.page.dart'; import 'package:immich_mobile/pages/sharing/shared_link/shared_link.page.dart';
import 'package:immich_mobile/pages/sharing/shared_link/shared_link_edit.page.dart';
import 'package:immich_mobile/pages/sharing/sharing.page.dart'; import 'package:immich_mobile/pages/sharing/sharing.page.dart';
import 'package:immich_mobile/pages/common/splash_screen.page.dart'; import 'package:immich_mobile/providers/api.provider.dart';
import 'package:immich_mobile/pages/common/tab_controller.page.dart'; import 'package:immich_mobile/providers/gallery_permission.provider.dart';
import 'package:immich_mobile/pages/common/video_viewer.page.dart'; import 'package:immich_mobile/routing/auth_guard.dart';
import 'package:immich_mobile/routing/backup_permission_guard.dart';
import 'package:immich_mobile/routing/custom_transition_builders.dart';
import 'package:immich_mobile/routing/duplicate_guard.dart';
import 'package:immich_mobile/services/api.service.dart'; import 'package:immich_mobile/services/api.service.dart';
import 'package:isar/isar.dart'; import 'package:isar/isar.dart';
import 'package:maplibre_gl/maplibre_gl.dart'; import 'package:maplibre_gl/maplibre_gl.dart';
@ -120,10 +119,6 @@ class AppRouter extends _$AppRouter {
guards: [_authGuard, _duplicateGuard], guards: [_authGuard, _duplicateGuard],
transitionsBuilder: CustomTransitionsBuilders.zoomedPage, transitionsBuilder: CustomTransitionsBuilders.zoomedPage,
), ),
AutoRoute(
page: VideoViewerRoute.page,
guards: [_authGuard, _duplicateGuard],
),
AutoRoute( AutoRoute(
page: BackupControllerRoute.page, page: BackupControllerRoute.page,
guards: [_authGuard, _duplicateGuard, _backupPermissionGuard], guards: [_authGuard, _duplicateGuard, _backupPermissionGuard],

View file

@ -21,6 +21,29 @@ abstract class _$AppRouter extends RootStackRouter {
child: const ActivitiesPage(), child: const ActivitiesPage(),
); );
}, },
AlbumAdditionalSharedUserSelectionRoute.name: (routeData) {
final args =
routeData.argsAs<AlbumAdditionalSharedUserSelectionRouteArgs>();
return AutoRoutePage<List<String>?>(
routeData: routeData,
child: AlbumAdditionalSharedUserSelectionPage(
key: args.key,
album: args.album,
),
);
},
AlbumAssetSelectionRoute.name: (routeData) {
final args = routeData.argsAs<AlbumAssetSelectionRouteArgs>();
return AutoRoutePage<AssetSelectionPageResult?>(
routeData: routeData,
child: AlbumAssetSelectionPage(
key: args.key,
existingAssets: args.existingAssets,
canDeselect: args.canDeselect,
query: args.query,
),
);
},
AlbumOptionsRoute.name: (routeData) { AlbumOptionsRoute.name: (routeData) {
final args = routeData.argsAs<AlbumOptionsRouteArgs>(); final args = routeData.argsAs<AlbumOptionsRouteArgs>();
return AutoRoutePage<dynamic>( return AutoRoutePage<dynamic>(
@ -41,6 +64,16 @@ abstract class _$AppRouter extends RootStackRouter {
), ),
); );
}, },
AlbumSharedUserSelectionRoute.name: (routeData) {
final args = routeData.argsAs<AlbumSharedUserSelectionRouteArgs>();
return AutoRoutePage<List<String>>(
routeData: routeData,
child: AlbumSharedUserSelectionPage(
key: args.key,
assets: args.assets,
),
);
},
AlbumViewerRoute.name: (routeData) { AlbumViewerRoute.name: (routeData) {
final args = routeData.argsAs<AlbumViewerRouteArgs>(); final args = routeData.argsAs<AlbumViewerRouteArgs>();
return AutoRoutePage<dynamic>( return AutoRoutePage<dynamic>(
@ -97,18 +130,6 @@ abstract class _$AppRouter extends RootStackRouter {
child: const ArchivePage(), child: const ArchivePage(),
); );
}, },
AlbumAssetSelectionRoute.name: (routeData) {
final args = routeData.argsAs<AssetSelectionRouteArgs>();
return AutoRoutePage<AssetSelectionPageResult?>(
routeData: routeData,
child: AlbumAssetSelectionPage(
key: args.key,
existingAssets: args.existingAssets,
canDeselect: args.canDeselect,
query: args.query,
),
);
},
BackupAlbumSelectionRoute.name: (routeData) { BackupAlbumSelectionRoute.name: (routeData) {
return AutoRoutePage<dynamic>( return AutoRoutePage<dynamic>(
routeData: routeData, routeData: routeData,
@ -170,12 +191,6 @@ abstract class _$AppRouter extends RootStackRouter {
), ),
); );
}, },
PhotosRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const PhotosPage(),
);
},
LibraryRoute.name: (routeData) { LibraryRoute.name: (routeData) {
return AutoRoutePage<dynamic>( return AutoRoutePage<dynamic>(
routeData: routeData, routeData: routeData,
@ -249,6 +264,12 @@ abstract class _$AppRouter extends RootStackRouter {
), ),
); );
}, },
PhotosRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const PhotosPage(),
);
},
RecentlyAddedRoute.name: (routeData) { RecentlyAddedRoute.name: (routeData) {
return AutoRoutePage<dynamic>( return AutoRoutePage<dynamic>(
routeData: routeData, routeData: routeData,
@ -272,26 +293,6 @@ abstract class _$AppRouter extends RootStackRouter {
child: const SearchPage(), child: const SearchPage(),
); );
}, },
AlbumAdditionalSharedUserSelectionRoute.name: (routeData) {
final args = routeData.argsAs<SelectAdditionalUserForSharingRouteArgs>();
return AutoRoutePage<List<String>?>(
routeData: routeData,
child: AlbumAdditionalSharedUserSelectionPage(
key: args.key,
album: args.album,
),
);
},
AlbumSharedUserSelectionRoute.name: (routeData) {
final args = routeData.argsAs<SelectUserForSharingRouteArgs>();
return AutoRoutePage<List<String>>(
routeData: routeData,
child: AlbumSharedUserSelectionPage(
key: args.key,
assets: args.assets,
),
);
},
SettingsRoute.name: (routeData) { SettingsRoute.name: (routeData) {
return AutoRoutePage<dynamic>( return AutoRoutePage<dynamic>(
routeData: routeData, routeData: routeData,
@ -351,21 +352,6 @@ abstract class _$AppRouter extends RootStackRouter {
child: const TrashPage(), child: const TrashPage(),
); );
}, },
VideoViewerRoute.name: (routeData) {
final args = routeData.argsAs<VideoViewerRouteArgs>();
return AutoRoutePage<dynamic>(
routeData: routeData,
child: VideoViewerPage(
key: args.key,
asset: args.asset,
isMotionVideo: args.isMotionVideo,
placeholder: args.placeholder,
showControls: args.showControls,
hideControlsTimer: args.hideControlsTimer,
showDownloadingIndicator: args.showDownloadingIndicator,
),
);
},
}; };
} }
@ -383,6 +369,94 @@ class ActivitiesRoute extends PageRouteInfo<void> {
static const PageInfo<void> page = PageInfo<void>(name); static const PageInfo<void> page = PageInfo<void>(name);
} }
/// generated route for
/// [AlbumAdditionalSharedUserSelectionPage]
class AlbumAdditionalSharedUserSelectionRoute
extends PageRouteInfo<AlbumAdditionalSharedUserSelectionRouteArgs> {
AlbumAdditionalSharedUserSelectionRoute({
Key? key,
required Album album,
List<PageRouteInfo>? children,
}) : super(
AlbumAdditionalSharedUserSelectionRoute.name,
args: AlbumAdditionalSharedUserSelectionRouteArgs(
key: key,
album: album,
),
initialChildren: children,
);
static const String name = 'AlbumAdditionalSharedUserSelectionRoute';
static const PageInfo<AlbumAdditionalSharedUserSelectionRouteArgs> page =
PageInfo<AlbumAdditionalSharedUserSelectionRouteArgs>(name);
}
class AlbumAdditionalSharedUserSelectionRouteArgs {
const AlbumAdditionalSharedUserSelectionRouteArgs({
this.key,
required this.album,
});
final Key? key;
final Album album;
@override
String toString() {
return 'AlbumAdditionalSharedUserSelectionRouteArgs{key: $key, album: $album}';
}
}
/// generated route for
/// [AlbumAssetSelectionPage]
class AlbumAssetSelectionRoute
extends PageRouteInfo<AlbumAssetSelectionRouteArgs> {
AlbumAssetSelectionRoute({
Key? key,
required Set<Asset> existingAssets,
bool canDeselect = false,
required QueryBuilder<Asset, Asset, QAfterSortBy>? query,
List<PageRouteInfo>? children,
}) : super(
AlbumAssetSelectionRoute.name,
args: AlbumAssetSelectionRouteArgs(
key: key,
existingAssets: existingAssets,
canDeselect: canDeselect,
query: query,
),
initialChildren: children,
);
static const String name = 'AlbumAssetSelectionRoute';
static const PageInfo<AlbumAssetSelectionRouteArgs> page =
PageInfo<AlbumAssetSelectionRouteArgs>(name);
}
class AlbumAssetSelectionRouteArgs {
const AlbumAssetSelectionRouteArgs({
this.key,
required this.existingAssets,
this.canDeselect = false,
required this.query,
});
final Key? key;
final Set<Asset> existingAssets;
final bool canDeselect;
final QueryBuilder<Asset, Asset, QAfterSortBy>? query;
@override
String toString() {
return 'AlbumAssetSelectionRouteArgs{key: $key, existingAssets: $existingAssets, canDeselect: $canDeselect, query: $query}';
}
}
/// generated route for /// generated route for
/// [AlbumOptionsPage] /// [AlbumOptionsPage]
class AlbumOptionsRoute extends PageRouteInfo<AlbumOptionsRouteArgs> { class AlbumOptionsRoute extends PageRouteInfo<AlbumOptionsRouteArgs> {
@ -459,6 +533,45 @@ class AlbumPreviewRouteArgs {
} }
} }
/// generated route for
/// [AlbumSharedUserSelectionPage]
class AlbumSharedUserSelectionRoute
extends PageRouteInfo<AlbumSharedUserSelectionRouteArgs> {
AlbumSharedUserSelectionRoute({
Key? key,
required Set<Asset> assets,
List<PageRouteInfo>? children,
}) : super(
AlbumSharedUserSelectionRoute.name,
args: AlbumSharedUserSelectionRouteArgs(
key: key,
assets: assets,
),
initialChildren: children,
);
static const String name = 'AlbumSharedUserSelectionRoute';
static const PageInfo<AlbumSharedUserSelectionRouteArgs> page =
PageInfo<AlbumSharedUserSelectionRouteArgs>(name);
}
class AlbumSharedUserSelectionRouteArgs {
const AlbumSharedUserSelectionRouteArgs({
this.key,
required this.assets,
});
final Key? key;
final Set<Asset> assets;
@override
String toString() {
return 'AlbumSharedUserSelectionRouteArgs{key: $key, assets: $assets}';
}
}
/// generated route for /// generated route for
/// [AlbumViewerPage] /// [AlbumViewerPage]
class AlbumViewerRoute extends PageRouteInfo<AlbumViewerRouteArgs> { class AlbumViewerRoute extends PageRouteInfo<AlbumViewerRouteArgs> {
@ -619,54 +732,6 @@ class ArchiveRoute extends PageRouteInfo<void> {
static const PageInfo<void> page = PageInfo<void>(name); static const PageInfo<void> page = PageInfo<void>(name);
} }
/// generated route for
/// [AlbumAssetSelectionPage]
class AlbumAssetSelectionRoute extends PageRouteInfo<AssetSelectionRouteArgs> {
AlbumAssetSelectionRoute({
Key? key,
required Set<Asset> existingAssets,
bool canDeselect = false,
required QueryBuilder<Asset, Asset, QAfterSortBy>? query,
List<PageRouteInfo>? children,
}) : super(
AlbumAssetSelectionRoute.name,
args: AssetSelectionRouteArgs(
key: key,
existingAssets: existingAssets,
canDeselect: canDeselect,
query: query,
),
initialChildren: children,
);
static const String name = 'AlbumAssetSelectionRoute';
static const PageInfo<AssetSelectionRouteArgs> page =
PageInfo<AssetSelectionRouteArgs>(name);
}
class AssetSelectionRouteArgs {
const AssetSelectionRouteArgs({
this.key,
required this.existingAssets,
this.canDeselect = false,
required this.query,
});
final Key? key;
final Set<Asset> existingAssets;
final bool canDeselect;
final QueryBuilder<Asset, Asset, QAfterSortBy>? query;
@override
String toString() {
return 'AssetSelectionRouteArgs{key: $key, existingAssets: $existingAssets, canDeselect: $canDeselect, query: $query}';
}
}
/// generated route for /// generated route for
/// [BackupAlbumSelectionPage] /// [BackupAlbumSelectionPage]
class BackupAlbumSelectionRoute extends PageRouteInfo<void> { class BackupAlbumSelectionRoute extends PageRouteInfo<void> {
@ -852,20 +917,6 @@ class GalleryViewerRouteArgs {
} }
} }
/// generated route for
/// [PhotosPage]
class PhotosRoute extends PageRouteInfo<void> {
const PhotosRoute({List<PageRouteInfo>? children})
: super(
PhotosRoute.name,
initialChildren: children,
);
static const String name = 'PhotosRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for /// generated route for
/// [LibraryPage] /// [LibraryPage]
class LibraryRoute extends PageRouteInfo<void> { class LibraryRoute extends PageRouteInfo<void> {
@ -1097,6 +1148,20 @@ class PersonResultRouteArgs {
} }
} }
/// generated route for
/// [PhotosPage]
class PhotosRoute extends PageRouteInfo<void> {
const PhotosRoute({List<PageRouteInfo>? children})
: super(
PhotosRoute.name,
initialChildren: children,
);
static const String name = 'PhotosRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for /// generated route for
/// [RecentlyAddedPage] /// [RecentlyAddedPage]
class RecentlyAddedRoute extends PageRouteInfo<void> { class RecentlyAddedRoute extends PageRouteInfo<void> {
@ -1163,84 +1228,6 @@ class SearchRoute extends PageRouteInfo<void> {
static const PageInfo<void> page = PageInfo<void>(name); static const PageInfo<void> page = PageInfo<void>(name);
} }
/// generated route for
/// [AlbumAdditionalSharedUserSelectionPage]
class AlbumAdditionalSharedUserSelectionRoute
extends PageRouteInfo<SelectAdditionalUserForSharingRouteArgs> {
AlbumAdditionalSharedUserSelectionRoute({
Key? key,
required Album album,
List<PageRouteInfo>? children,
}) : super(
AlbumAdditionalSharedUserSelectionRoute.name,
args: SelectAdditionalUserForSharingRouteArgs(
key: key,
album: album,
),
initialChildren: children,
);
static const String name = 'AlbumAdditionalSharedUserSelectionRoute';
static const PageInfo<SelectAdditionalUserForSharingRouteArgs> page =
PageInfo<SelectAdditionalUserForSharingRouteArgs>(name);
}
class SelectAdditionalUserForSharingRouteArgs {
const SelectAdditionalUserForSharingRouteArgs({
this.key,
required this.album,
});
final Key? key;
final Album album;
@override
String toString() {
return 'SelectAdditionalUserForSharingRouteArgs{key: $key, album: $album}';
}
}
/// generated route for
/// [AlbumSharedUserSelectionPage]
class AlbumSharedUserSelectionRoute
extends PageRouteInfo<SelectUserForSharingRouteArgs> {
AlbumSharedUserSelectionRoute({
Key? key,
required Set<Asset> assets,
List<PageRouteInfo>? children,
}) : super(
AlbumSharedUserSelectionRoute.name,
args: SelectUserForSharingRouteArgs(
key: key,
assets: assets,
),
initialChildren: children,
);
static const String name = 'AlbumSharedUserSelectionRoute';
static const PageInfo<SelectUserForSharingRouteArgs> page =
PageInfo<SelectUserForSharingRouteArgs>(name);
}
class SelectUserForSharingRouteArgs {
const SelectUserForSharingRouteArgs({
this.key,
required this.assets,
});
final Key? key;
final Set<Asset> assets;
@override
String toString() {
return 'SelectUserForSharingRouteArgs{key: $key, assets: $assets}';
}
}
/// generated route for /// generated route for
/// [SettingsPage] /// [SettingsPage]
class SettingsRoute extends PageRouteInfo<void> { class SettingsRoute extends PageRouteInfo<void> {
@ -1410,66 +1397,3 @@ class TrashRoute extends PageRouteInfo<void> {
static const PageInfo<void> page = PageInfo<void>(name); static const PageInfo<void> page = PageInfo<void>(name);
} }
/// generated route for
/// [VideoViewerPage]
class VideoViewerRoute extends PageRouteInfo<VideoViewerRouteArgs> {
VideoViewerRoute({
Key? key,
required Asset asset,
bool isMotionVideo = false,
Widget? placeholder,
bool showControls = true,
Duration hideControlsTimer = const Duration(seconds: 5),
bool showDownloadingIndicator = true,
List<PageRouteInfo>? children,
}) : super(
VideoViewerRoute.name,
args: VideoViewerRouteArgs(
key: key,
asset: asset,
isMotionVideo: isMotionVideo,
placeholder: placeholder,
showControls: showControls,
hideControlsTimer: hideControlsTimer,
showDownloadingIndicator: showDownloadingIndicator,
),
initialChildren: children,
);
static const String name = 'VideoViewerRoute';
static const PageInfo<VideoViewerRouteArgs> page =
PageInfo<VideoViewerRouteArgs>(name);
}
class VideoViewerRouteArgs {
const VideoViewerRouteArgs({
this.key,
required this.asset,
this.isMotionVideo = false,
this.placeholder,
this.showControls = true,
this.hideControlsTimer = const Duration(seconds: 5),
this.showDownloadingIndicator = true,
});
final Key? key;
final Asset asset;
final bool isMotionVideo;
final Widget? placeholder;
final bool showControls;
final Duration hideControlsTimer;
final bool showDownloadingIndicator;
@override
String toString() {
return 'VideoViewerRouteArgs{key: $key, asset: $asset, isMotionVideo: $isMotionVideo, placeholder: $placeholder, showControls: $showControls, hideControlsTimer: $hideControlsTimer, showDownloadingIndicator: $showDownloadingIndicator}';
}
}

View file

@ -275,7 +275,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
); );
} else { } else {
return IconButton( return IconButton(
onPressed: () async => await context.popRoute(), onPressed: () async => await context.maybePop(),
icon: const Icon(Icons.arrow_back_ios_rounded), icon: const Icon(Icons.arrow_back_ios_rounded),
splashRadius: 25, splashRadius: 25,
); );

View file

@ -110,7 +110,7 @@ class BottomGalleryBar extends ConsumerWidget {
if (isDeleted && isParent) { if (isDeleted && isParent) {
if (totalAssets == 1) { if (totalAssets == 1) {
// Handle only one asset // Handle only one asset
context.popRoute(); context.maybePop();
} else { } else {
// Go to next page otherwise // Go to next page otherwise
controller.nextPage( controller.nextPage(
@ -181,7 +181,7 @@ class BottomGalleryBar extends ConsumerWidget {
stackElements.elementAt(stackIndex), stackElements.elementAt(stackIndex),
); );
ctx.pop(); ctx.pop();
context.popRoute(); context.maybePop();
}, },
title: const Text( title: const Text(
"viewer_stack_use_as_main_asset", "viewer_stack_use_as_main_asset",
@ -208,7 +208,7 @@ class BottomGalleryBar extends ConsumerWidget {
childrenToRemove: [asset], childrenToRemove: [asset],
); );
ctx.pop(); ctx.pop();
context.popRoute(); context.maybePop();
} else { } else {
await ref.read(assetStackServiceProvider).updateStack( await ref.read(assetStackServiceProvider).updateStack(
asset, asset,
@ -236,7 +236,7 @@ class BottomGalleryBar extends ConsumerWidget {
childrenToRemove: stack, childrenToRemove: stack,
); );
ctx.pop(); ctx.pop();
context.popRoute(); context.maybePop();
}, },
title: const Text( title: const Text(
"viewer_unstack", "viewer_unstack",
@ -267,7 +267,7 @@ class BottomGalleryBar extends ConsumerWidget {
handleArchive() { handleArchive() {
ref.read(assetProvider.notifier).toggleArchive([asset]); ref.read(assetProvider.notifier).toggleArchive([asset]);
if (isParent) { if (isParent) {
context.popRoute(); context.maybePop();
return; return;
} }
removeAssetFromStack(); removeAssetFromStack();

View file

@ -161,7 +161,7 @@ class TopControlAppBar extends HookConsumerWidget {
Widget buildBackButton() { Widget buildBackButton() {
return IconButton( return IconButton(
onPressed: () { onPressed: () {
context.popRoute(); context.maybePop();
}, },
icon: Icon( icon: Icon(
Icons.arrow_back_ios_new_rounded, Icons.arrow_back_ios_new_rounded,

View file

@ -79,7 +79,7 @@ class _LocationPicker extends HookWidget {
).tr(), ).tr(),
), ),
TextButton( TextButton(
onPressed: () => context.popRoute(latlng), onPressed: () => context.maybePop(latlng),
child: Text( child: Text(
"action_common_update", "action_common_update",
style: context.textTheme.bodyMedium?.copyWith( style: context.textTheme.bodyMedium?.copyWith(

View file

@ -50,7 +50,7 @@ class _NonSelectionRow extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
ElevatedButton( ElevatedButton(
onPressed: () => context.popRoute(), onPressed: () => context.maybePop(),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
shape: const CircleBorder(), shape: const CircleBorder(),
), ),

View file

@ -43,7 +43,7 @@ class MemoryBottomInfo extends StatelessWidget {
MaterialButton( MaterialButton(
minWidth: 0, minWidth: 0,
onPressed: () { onPressed: () {
context.popRoute(); context.maybePop();
scrollToDateNotifierProvider scrollToDateNotifierProvider
.scrollToDate(memory.assets[0].fileCreatedAt); .scrollToDate(memory.assets[0].fileCreatedAt);
}, },

View file

@ -61,18 +61,18 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: auto_route name: auto_route
sha256: "82f8df1d177416bc6b7a449127d0270ff1f0f633a91f2ceb7a85d4f07c3affa1" sha256: "6cad3f408863ffff2b5757967c802b18415dac4acb1b40c5cdd45d0a26e5080f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.8.4" version: "8.1.3"
auto_route_generator: auto_route_generator:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: auto_route_generator name: auto_route_generator
sha256: "11067a3bcd643812518fe26c0c9ec073990286cabfd9d74b6da9ef9b913c4d22" sha256: ba28133d3a3bf0a66772bcc98dade5843753cd9f1a8fb4802b842895515b67d3
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.3.2" version: "8.0.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:

View file

@ -22,7 +22,7 @@ dependencies:
cached_network_image: ^3.3.1 cached_network_image: ^3.3.1
flutter_cache_manager: ^3.3.1 flutter_cache_manager: ^3.3.1
intl: ^0.18.0 intl: ^0.18.0
auto_route: ^7.8.4 auto_route: ^8.0.2
fluttertoast: ^8.2.4 fluttertoast: ^8.2.4
video_player: ^2.8.2 video_player: ^2.8.2
chewie: ^1.7.4 chewie: ^1.7.4
@ -88,7 +88,7 @@ dev_dependencies:
sdk: flutter sdk: flutter
flutter_lints: ^4.0.0 flutter_lints: ^4.0.0
build_runner: ^2.4.8 build_runner: ^2.4.8
auto_route_generator: ^7.3.2 auto_route_generator: ^8.0.0
flutter_launcher_icons: ^0.13.1 flutter_launcher_icons: ^0.13.1
flutter_native_splash: ^2.3.9 flutter_native_splash: ^2.3.9
isar_generator: ^3.1.0+1 isar_generator: ^3.1.0+1