From ba5cca934814e5b091d517213ceb1a282ea06ce6 Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:50:33 +0000 Subject: [PATCH] chore(dep): update auto_route (#6390) * chore(dep): update auto_route * chore: rebase main --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- .../activities/views/activities_page.dart | 2 + .../album/views/album_options_part.dart | 1 + .../album/views/album_viewer_page.dart | 1 + .../album/views/asset_selection_page.dart | 1 + .../album/views/create_album_page.dart | 1 + .../lib/modules/album/views/library_page.dart | 1 + ...lect_additional_user_for_sharing_page.dart | 1 + .../views/select_user_for_sharing_page.dart | 1 + .../lib/modules/album/views/sharing_page.dart | 1 + .../modules/archive/views/archive_page.dart | 1 + .../asset_viewer/views/gallery_viewer.dart | 1 + .../asset_viewer/views/video_viewer_page.dart | 2 + .../backup/views/album_preview_page.dart | 1 + .../views/backup_album_selection_page.dart | 1 + .../backup/views/backup_controller_page.dart | 1 + .../backup/views/backup_options_page.dart | 1 + .../views/failed_backup_status_page.dart | 1 + .../favorite/views/favorites_page.dart | 1 + mobile/lib/modules/home/views/home_page.dart | 2 + .../login/ui/change_password_form.dart | 4 +- .../login/views/change_password_page.dart | 2 + .../lib/modules/login/views/login_page.dart | 1 + .../map/views/map_location_picker_page.dart | 7 +- mobile/lib/modules/map/views/map_page.dart | 1 + .../modules/memories/views/memory_page.dart | 1 + .../views/permission_onboarding_page.dart | 1 + .../partner/views/partner_detail_page.dart | 2 + .../modules/partner/views/partner_page.dart | 2 + .../search/views/all_motion_videos_page.dart | 1 + .../modules/search/views/all_people_page.dart | 1 + .../modules/search/views/all_videos_page.dart | 1 + .../search/views/curated_location_page.dart | 1 + .../search/views/person_result_page.dart | 1 + .../search/views/recently_added_page.dart | 1 + .../lib/modules/search/views/search_page.dart | 1 + .../search/views/search_result_page.dart | 1 + .../modules/settings/views/settings_page.dart | 2 + .../views/shared_link_edit_page.dart | 1 + .../shared_link/views/shared_link_page.dart | 2 + .../lib/modules/trash/views/trash_page.dart | 1 + mobile/lib/routing/router.dart | 241 +- mobile/lib/routing/router.gr.dart | 2765 ++++++++--------- .../lib/shared/views/app_log_detail_page.dart | 2 + mobile/lib/shared/views/app_log_page.dart | 1 + mobile/lib/shared/views/splash_screen.dart | 1 + .../lib/shared/views/tab_controller_page.dart | 38 +- mobile/pubspec.lock | 10 +- mobile/pubspec.yaml | 4 +- 48 files changed, 1473 insertions(+), 1646 deletions(-) diff --git a/mobile/lib/modules/activities/views/activities_page.dart b/mobile/lib/modules/activities/views/activities_page.dart index d908d83c12..0510a72c7c 100644 --- a/mobile/lib/modules/activities/views/activities_page.dart +++ b/mobile/lib/modules/activities/views/activities_page.dart @@ -1,3 +1,4 @@ +import 'package:auto_route/auto_route.dart'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart' hide Store; @@ -13,6 +14,7 @@ import 'package:immich_mobile/modules/album/providers/current_album.provider.dar import 'package:immich_mobile/modules/asset_viewer/providers/current_asset.provider.dart'; import 'package:immich_mobile/shared/providers/user.provider.dart'; +@RoutePage() class ActivitiesPage extends HookConsumerWidget { const ActivitiesPage({ super.key, diff --git a/mobile/lib/modules/album/views/album_options_part.dart b/mobile/lib/modules/album/views/album_options_part.dart index 4e07d3c0e5..832db7cb88 100644 --- a/mobile/lib/modules/album/views/album_options_part.dart +++ b/mobile/lib/modules/album/views/album_options_part.dart @@ -14,6 +14,7 @@ import 'package:immich_mobile/shared/ui/immich_toast.dart'; import 'package:immich_mobile/shared/ui/user_circle_avatar.dart'; import 'package:immich_mobile/shared/views/immich_loading_overlay.dart'; +@RoutePage() class AlbumOptionsPage extends HookConsumerWidget { final Album album; diff --git a/mobile/lib/modules/album/views/album_viewer_page.dart b/mobile/lib/modules/album/views/album_viewer_page.dart index af6077cebc..0356f023a5 100644 --- a/mobile/lib/modules/album/views/album_viewer_page.dart +++ b/mobile/lib/modules/album/views/album_viewer_page.dart @@ -27,6 +27,7 @@ import 'package:immich_mobile/shared/ui/immich_toast.dart'; import 'package:immich_mobile/shared/ui/user_circle_avatar.dart'; import 'package:immich_mobile/shared/views/immich_loading_overlay.dart'; +@RoutePage() class AlbumViewerPage extends HookConsumerWidget { final int albumId; diff --git a/mobile/lib/modules/album/views/asset_selection_page.dart b/mobile/lib/modules/album/views/asset_selection_page.dart index 471a74ace5..4d54e9420b 100644 --- a/mobile/lib/modules/album/views/asset_selection_page.dart +++ b/mobile/lib/modules/album/views/asset_selection_page.dart @@ -12,6 +12,7 @@ import 'package:immich_mobile/modules/home/ui/asset_grid/immich_asset_grid.dart' import 'package:immich_mobile/shared/models/asset.dart'; import 'package:isar/isar.dart'; +@RoutePage() class AssetSelectionPage extends HookConsumerWidget { const AssetSelectionPage({ Key? key, diff --git a/mobile/lib/modules/album/views/create_album_page.dart b/mobile/lib/modules/album/views/create_album_page.dart index d339421dce..2c26a98d35 100644 --- a/mobile/lib/modules/album/views/create_album_page.dart +++ b/mobile/lib/modules/album/views/create_album_page.dart @@ -14,6 +14,7 @@ import 'package:immich_mobile/routing/router.dart'; import 'package:immich_mobile/shared/models/asset.dart'; import 'package:immich_mobile/shared/providers/asset.provider.dart'; +@RoutePage() // ignore: must_be_immutable class CreateAlbumPage extends HookConsumerWidget { final bool isSharedAlbum; diff --git a/mobile/lib/modules/album/views/library_page.dart b/mobile/lib/modules/album/views/library_page.dart index 68b3414218..9b3e49020d 100644 --- a/mobile/lib/modules/album/views/library_page.dart +++ b/mobile/lib/modules/album/views/library_page.dart @@ -11,6 +11,7 @@ import 'package:immich_mobile/routing/router.dart'; import 'package:immich_mobile/shared/providers/server_info.provider.dart'; import 'package:immich_mobile/shared/ui/immich_app_bar.dart'; +@RoutePage() class LibraryPage extends HookConsumerWidget { const LibraryPage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/album/views/select_additional_user_for_sharing_page.dart b/mobile/lib/modules/album/views/select_additional_user_for_sharing_page.dart index 7f7b1cb0ec..23452050e4 100644 --- a/mobile/lib/modules/album/views/select_additional_user_for_sharing_page.dart +++ b/mobile/lib/modules/album/views/select_additional_user_for_sharing_page.dart @@ -10,6 +10,7 @@ import 'package:immich_mobile/shared/models/album.dart'; import 'package:immich_mobile/shared/models/user.dart'; import 'package:immich_mobile/shared/ui/user_circle_avatar.dart'; +@RoutePage?>() class SelectAdditionalUserForSharingPage extends HookConsumerWidget { final Album album; diff --git a/mobile/lib/modules/album/views/select_user_for_sharing_page.dart b/mobile/lib/modules/album/views/select_user_for_sharing_page.dart index 1089e910c0..8c58ff90d8 100644 --- a/mobile/lib/modules/album/views/select_user_for_sharing_page.dart +++ b/mobile/lib/modules/album/views/select_user_for_sharing_page.dart @@ -13,6 +13,7 @@ import 'package:immich_mobile/shared/models/asset.dart'; import 'package:immich_mobile/shared/models/user.dart'; import 'package:immich_mobile/shared/ui/user_circle_avatar.dart'; +@RoutePage>() class SelectUserForSharingPage extends HookConsumerWidget { const SelectUserForSharingPage({Key? key, required this.assets}) : super(key: key); diff --git a/mobile/lib/modules/album/views/sharing_page.dart b/mobile/lib/modules/album/views/sharing_page.dart index 119caf58f2..50ecca9ad5 100644 --- a/mobile/lib/modules/album/views/sharing_page.dart +++ b/mobile/lib/modules/album/views/sharing_page.dart @@ -14,6 +14,7 @@ import 'package:immich_mobile/shared/providers/user.provider.dart'; import 'package:immich_mobile/shared/ui/immich_app_bar.dart'; import 'package:immich_mobile/shared/ui/immich_image.dart'; +@RoutePage() class SharingPage extends HookConsumerWidget { const SharingPage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/archive/views/archive_page.dart b/mobile/lib/modules/archive/views/archive_page.dart index e3dc77cf9b..1f96425f48 100644 --- a/mobile/lib/modules/archive/views/archive_page.dart +++ b/mobile/lib/modules/archive/views/archive_page.dart @@ -6,6 +6,7 @@ import 'package:immich_mobile/modules/archive/providers/archive_asset_provider.d import 'package:immich_mobile/modules/home/providers/multiselect.provider.dart'; import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart'; +@RoutePage() class ArchivePage extends HookConsumerWidget { const ArchivePage({super.key}); diff --git a/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart b/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart index 4cb2dd032d..760af3e06f 100644 --- a/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart +++ b/mobile/lib/modules/asset_viewer/views/gallery_viewer.dart @@ -46,6 +46,7 @@ import 'package:immich_mobile/utils/image_url_builder.dart'; import 'package:isar/isar.dart'; import 'package:openapi/api.dart' show ThumbnailFormat; +@RoutePage() // ignore: must_be_immutable class GalleryViewerPage extends HookConsumerWidget { final Asset Function(int index) loadAsset; diff --git a/mobile/lib/modules/asset_viewer/views/video_viewer_page.dart b/mobile/lib/modules/asset_viewer/views/video_viewer_page.dart index ad929a8c5e..463d211a6b 100644 --- a/mobile/lib/modules/asset_viewer/views/video_viewer_page.dart +++ b/mobile/lib/modules/asset_viewer/views/video_viewer_page.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:chewie/chewie.dart'; @@ -14,6 +15,7 @@ import 'package:photo_manager/photo_manager.dart'; import 'package:video_player/video_player.dart'; import 'package:wakelock_plus/wakelock_plus.dart'; +@RoutePage() // ignore: must_be_immutable class VideoViewerPage extends HookConsumerWidget { final Asset asset; diff --git a/mobile/lib/modules/backup/views/album_preview_page.dart b/mobile/lib/modules/backup/views/album_preview_page.dart index 3e308e9651..234df958a6 100644 --- a/mobile/lib/modules/backup/views/album_preview_page.dart +++ b/mobile/lib/modules/backup/views/album_preview_page.dart @@ -7,6 +7,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:immich_mobile/shared/ui/immich_loading_indicator.dart'; import 'package:photo_manager/photo_manager.dart'; +@RoutePage() class AlbumPreviewPage extends HookConsumerWidget { final AssetPathEntity album; const AlbumPreviewPage({Key? key, required this.album}) : super(key: key); diff --git a/mobile/lib/modules/backup/views/backup_album_selection_page.dart b/mobile/lib/modules/backup/views/backup_album_selection_page.dart index 5673055f0b..c6dd6d3ab5 100644 --- a/mobile/lib/modules/backup/views/backup_album_selection_page.dart +++ b/mobile/lib/modules/backup/views/backup_album_selection_page.dart @@ -10,6 +10,7 @@ import 'package:immich_mobile/modules/backup/ui/album_info_card.dart'; import 'package:immich_mobile/modules/backup/ui/album_info_list_tile.dart'; import 'package:immich_mobile/shared/ui/immich_loading_indicator.dart'; +@RoutePage() class BackupAlbumSelectionPage extends HookConsumerWidget { const BackupAlbumSelectionPage({Key? key}) : super(key: key); @override diff --git a/mobile/lib/modules/backup/views/backup_controller_page.dart b/mobile/lib/modules/backup/views/backup_controller_page.dart index 8dd973f40c..61122fd74b 100644 --- a/mobile/lib/modules/backup/views/backup_controller_page.dart +++ b/mobile/lib/modules/backup/views/backup_controller_page.dart @@ -18,6 +18,7 @@ import 'package:immich_mobile/routing/router.dart'; import 'package:immich_mobile/shared/providers/websocket.provider.dart'; import 'package:immich_mobile/modules/backup/ui/backup_info_card.dart'; +@RoutePage() class BackupControllerPage extends HookConsumerWidget { const BackupControllerPage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/backup/views/backup_options_page.dart b/mobile/lib/modules/backup/views/backup_options_page.dart index d8aab96764..898101a657 100644 --- a/mobile/lib/modules/backup/views/backup_options_page.dart +++ b/mobile/lib/modules/backup/views/backup_options_page.dart @@ -23,6 +23,7 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:wakelock_plus/wakelock_plus.dart'; +@RoutePage() class BackupOptionsPage extends HookConsumerWidget { const BackupOptionsPage({Key? key}) : super(key: key); @override diff --git a/mobile/lib/modules/backup/views/failed_backup_status_page.dart b/mobile/lib/modules/backup/views/failed_backup_status_page.dart index 8266e01f43..7af47d6f93 100644 --- a/mobile/lib/modules/backup/views/failed_backup_status_page.dart +++ b/mobile/lib/modules/backup/views/failed_backup_status_page.dart @@ -6,6 +6,7 @@ import 'package:immich_mobile/modules/backup/providers/error_backup_list.provide import 'package:intl/intl.dart'; import 'package:photo_manager/photo_manager.dart'; +@RoutePage() class FailedBackupStatusPage extends HookConsumerWidget { const FailedBackupStatusPage({Key? key}) : super(key: key); @override diff --git a/mobile/lib/modules/favorite/views/favorites_page.dart b/mobile/lib/modules/favorite/views/favorites_page.dart index e7c73d8fe5..a3e4b435aa 100644 --- a/mobile/lib/modules/favorite/views/favorites_page.dart +++ b/mobile/lib/modules/favorite/views/favorites_page.dart @@ -6,6 +6,7 @@ import 'package:immich_mobile/modules/favorite/providers/favorite_provider.dart' import 'package:immich_mobile/modules/home/providers/multiselect.provider.dart'; import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart'; +@RoutePage() class FavoritesPage extends HookConsumerWidget { const FavoritesPage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/home/views/home_page.dart b/mobile/lib/modules/home/views/home_page.dart index fc797c5b0e..ac0e89f6ae 100644 --- a/mobile/lib/modules/home/views/home_page.dart +++ b/mobile/lib/modules/home/views/home_page.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:auto_route/auto_route.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; @@ -17,6 +18,7 @@ import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart'; import 'package:immich_mobile/shared/ui/immich_app_bar.dart'; import 'package:immich_mobile/shared/ui/immich_loading_indicator.dart'; +@RoutePage() class HomePage extends HookConsumerWidget { const HomePage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/login/ui/change_password_form.dart b/mobile/lib/modules/login/ui/change_password_form.dart index 560967821a..95143ef829 100644 --- a/mobile/lib/modules/login/ui/change_password_form.dart +++ b/mobile/lib/modules/login/ui/change_password_form.dart @@ -90,7 +90,7 @@ class ChangePasswordForm extends HookConsumerWidget { .clearAllAsset(); ref.read(websocketProvider.notifier).disconnect(); - AutoRouter.of(context).navigateBack(); + AutoRouter.of(context).back(); ImmichToast.show( context: context, @@ -111,7 +111,7 @@ class ChangePasswordForm extends HookConsumerWidget { ), TextButton.icon( icon: const Icon(Icons.arrow_back), - onPressed: () => AutoRouter.of(context).navigateBack(), + onPressed: () => AutoRouter.of(context).back(), label: const Text('Back'), ), ], diff --git a/mobile/lib/modules/login/views/change_password_page.dart b/mobile/lib/modules/login/views/change_password_page.dart index b5c8a6ca0d..60f3abe291 100644 --- a/mobile/lib/modules/login/views/change_password_page.dart +++ b/mobile/lib/modules/login/views/change_password_page.dart @@ -1,7 +1,9 @@ +import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:immich_mobile/modules/login/ui/change_password_form.dart'; +@RoutePage() class ChangePasswordPage extends HookConsumerWidget { const ChangePasswordPage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/login/views/login_page.dart b/mobile/lib/modules/login/views/login_page.dart index 04e4f1fe39..ee96b7da61 100644 --- a/mobile/lib/modules/login/views/login_page.dart +++ b/mobile/lib/modules/login/views/login_page.dart @@ -7,6 +7,7 @@ import 'package:immich_mobile/modules/login/ui/login_form.dart'; import 'package:immich_mobile/routing/router.dart'; import 'package:package_info_plus/package_info_plus.dart'; +@RoutePage() class LoginPage extends HookConsumerWidget { const LoginPage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/map/views/map_location_picker_page.dart b/mobile/lib/modules/map/views/map_location_picker_page.dart index 34634106df..a232638f74 100644 --- a/mobile/lib/modules/map/views/map_location_picker_page.dart +++ b/mobile/lib/modules/map/views/map_location_picker_page.dart @@ -13,6 +13,7 @@ import 'package:maplibre_gl/maplibre_gl.dart'; import 'package:immich_mobile/modules/map/utils/map_utils.dart'; import 'package:geolocator/geolocator.dart'; +@RoutePage() class MapLocationPickerPage extends HookConsumerWidget { final LatLng initialLatLng; @@ -45,7 +46,8 @@ class MapLocationPickerPage extends HookConsumerWidget { } Future getCurrentLocation() async { - var (currentLocation, locationPermission) = await MapUtils.checkPermAndGetLocation(context); + var (currentLocation, locationPermission) = + await MapUtils.checkPermAndGetLocation(context); if (locationPermission == LocationPermission.denied || locationPermission == LocationPermission.deniedForever) { return; @@ -53,7 +55,8 @@ class MapLocationPickerPage extends HookConsumerWidget { if (currentLocation == null) { return; } - var currentLatLng = LatLng(currentLocation.latitude, currentLocation.longitude); + var currentLatLng = + LatLng(currentLocation.latitude, currentLocation.longitude); selectedLatLng.value = currentLatLng; controller.value?.animateCamera(CameraUpdate.newLatLng(currentLatLng)); } diff --git a/mobile/lib/modules/map/views/map_page.dart b/mobile/lib/modules/map/views/map_page.dart index b01e29898b..1882e32616 100644 --- a/mobile/lib/modules/map/views/map_page.dart +++ b/mobile/lib/modules/map/views/map_page.dart @@ -29,6 +29,7 @@ import 'package:immich_mobile/shared/views/immich_loading_overlay.dart'; import 'package:immich_mobile/utils/debounce.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; +@RoutePage() class MapPage extends HookConsumerWidget { const MapPage({super.key}); diff --git a/mobile/lib/modules/memories/views/memory_page.dart b/mobile/lib/modules/memories/views/memory_page.dart index dc33151c4d..b961c2c293 100644 --- a/mobile/lib/modules/memories/views/memory_page.dart +++ b/mobile/lib/modules/memories/views/memory_page.dart @@ -10,6 +10,7 @@ import 'package:immich_mobile/shared/ui/immich_image.dart'; import 'package:intl/intl.dart'; import 'package:openapi/api.dart' as api; +@RoutePage() class MemoryPage extends HookConsumerWidget { final List memories; final int memoryIndex; diff --git a/mobile/lib/modules/onboarding/views/permission_onboarding_page.dart b/mobile/lib/modules/onboarding/views/permission_onboarding_page.dart index e801e5415e..47ad6f26a6 100644 --- a/mobile/lib/modules/onboarding/views/permission_onboarding_page.dart +++ b/mobile/lib/modules/onboarding/views/permission_onboarding_page.dart @@ -9,6 +9,7 @@ import 'package:immich_mobile/shared/ui/immich_logo.dart'; import 'package:immich_mobile/shared/ui/immich_title_text.dart'; import 'package:permission_handler/permission_handler.dart'; +@RoutePage() class PermissionOnboardingPage extends HookConsumerWidget { const PermissionOnboardingPage({super.key}); diff --git a/mobile/lib/modules/partner/views/partner_detail_page.dart b/mobile/lib/modules/partner/views/partner_detail_page.dart index 7ec48fd22d..e492eef113 100644 --- a/mobile/lib/modules/partner/views/partner_detail_page.dart +++ b/mobile/lib/modules/partner/views/partner_detail_page.dart @@ -1,3 +1,4 @@ +import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; @@ -8,6 +9,7 @@ import 'package:immich_mobile/shared/providers/asset.provider.dart'; import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart'; import 'package:immich_mobile/shared/ui/immich_toast.dart'; +@RoutePage() class PartnerDetailPage extends HookConsumerWidget { const PartnerDetailPage({Key? key, required this.partner}) : super(key: key); diff --git a/mobile/lib/modules/partner/views/partner_page.dart b/mobile/lib/modules/partner/views/partner_page.dart index e90250df52..4fb3fccf28 100644 --- a/mobile/lib/modules/partner/views/partner_page.dart +++ b/mobile/lib/modules/partner/views/partner_page.dart @@ -1,3 +1,4 @@ +import 'package:auto_route/auto_route.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; @@ -9,6 +10,7 @@ import 'package:immich_mobile/shared/ui/confirm_dialog.dart'; import 'package:immich_mobile/shared/ui/immich_toast.dart'; import 'package:immich_mobile/shared/ui/user_avatar.dart'; +@RoutePage() class PartnerPage extends HookConsumerWidget { const PartnerPage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/search/views/all_motion_videos_page.dart b/mobile/lib/modules/search/views/all_motion_videos_page.dart index 1fcadb36fc..2d68b8cfec 100644 --- a/mobile/lib/modules/search/views/all_motion_videos_page.dart +++ b/mobile/lib/modules/search/views/all_motion_videos_page.dart @@ -6,6 +6,7 @@ import 'package:immich_mobile/extensions/asyncvalue_extensions.dart'; import 'package:immich_mobile/modules/home/ui/asset_grid/immich_asset_grid.dart'; import 'package:immich_mobile/modules/search/providers/all_motion_photos.provider.dart'; +@RoutePage() class AllMotionPhotosPage extends HookConsumerWidget { const AllMotionPhotosPage({super.key}); diff --git a/mobile/lib/modules/search/views/all_people_page.dart b/mobile/lib/modules/search/views/all_people_page.dart index 9cd6639757..1f90922c11 100644 --- a/mobile/lib/modules/search/views/all_people_page.dart +++ b/mobile/lib/modules/search/views/all_people_page.dart @@ -6,6 +6,7 @@ import 'package:immich_mobile/extensions/asyncvalue_extensions.dart'; import 'package:immich_mobile/modules/search/providers/people.provider.dart'; import 'package:immich_mobile/modules/search/ui/explore_grid.dart'; +@RoutePage() class AllPeoplePage extends HookConsumerWidget { const AllPeoplePage({super.key}); diff --git a/mobile/lib/modules/search/views/all_videos_page.dart b/mobile/lib/modules/search/views/all_videos_page.dart index 6cf344f45f..98bfb97284 100644 --- a/mobile/lib/modules/search/views/all_videos_page.dart +++ b/mobile/lib/modules/search/views/all_videos_page.dart @@ -5,6 +5,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:immich_mobile/modules/search/providers/all_video_assets.provider.dart'; import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart'; +@RoutePage() class AllVideosPage extends HookConsumerWidget { const AllVideosPage({super.key}); diff --git a/mobile/lib/modules/search/views/curated_location_page.dart b/mobile/lib/modules/search/views/curated_location_page.dart index 1f144f657d..b216baf3ce 100644 --- a/mobile/lib/modules/search/views/curated_location_page.dart +++ b/mobile/lib/modules/search/views/curated_location_page.dart @@ -8,6 +8,7 @@ import 'package:immich_mobile/modules/search/providers/search_page_state.provide import 'package:immich_mobile/modules/search/ui/explore_grid.dart'; import 'package:openapi/api.dart'; +@RoutePage() class CuratedLocationPage extends HookConsumerWidget { const CuratedLocationPage({super.key}); diff --git a/mobile/lib/modules/search/views/person_result_page.dart b/mobile/lib/modules/search/views/person_result_page.dart index a4dfa0fd3c..8e09f47c34 100644 --- a/mobile/lib/modules/search/views/person_result_page.dart +++ b/mobile/lib/modules/search/views/person_result_page.dart @@ -10,6 +10,7 @@ import 'package:immich_mobile/shared/models/store.dart'; import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart'; import 'package:immich_mobile/utils/image_url_builder.dart'; +@RoutePage() class PersonResultPage extends HookConsumerWidget { final String personId; final String personName; diff --git a/mobile/lib/modules/search/views/recently_added_page.dart b/mobile/lib/modules/search/views/recently_added_page.dart index a2959babfd..bc17ef2af9 100644 --- a/mobile/lib/modules/search/views/recently_added_page.dart +++ b/mobile/lib/modules/search/views/recently_added_page.dart @@ -6,6 +6,7 @@ import 'package:immich_mobile/extensions/asyncvalue_extensions.dart'; import 'package:immich_mobile/modules/home/ui/asset_grid/immich_asset_grid.dart'; import 'package:immich_mobile/modules/search/providers/recently_added.provider.dart'; +@RoutePage() class RecentlyAddedPage extends HookConsumerWidget { const RecentlyAddedPage({super.key}); diff --git a/mobile/lib/modules/search/views/search_page.dart b/mobile/lib/modules/search/views/search_page.dart index c367674225..3c11b4093c 100644 --- a/mobile/lib/modules/search/views/search_page.dart +++ b/mobile/lib/modules/search/views/search_page.dart @@ -19,6 +19,7 @@ import 'package:immich_mobile/routing/router.dart'; import 'package:immich_mobile/shared/providers/server_info.provider.dart'; import 'package:immich_mobile/shared/ui/scaffold_error_body.dart'; +@RoutePage() // ignore: must_be_immutable class SearchPage extends HookConsumerWidget { SearchPage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/search/views/search_result_page.dart b/mobile/lib/modules/search/views/search_result_page.dart index 29823d53fb..8bf56042f8 100644 --- a/mobile/lib/modules/search/views/search_result_page.dart +++ b/mobile/lib/modules/search/views/search_result_page.dart @@ -25,6 +25,7 @@ SearchType _getSearchType(String searchTerm) { } } +@RoutePage() class SearchResultPage extends HookConsumerWidget { const SearchResultPage({ Key? key, diff --git a/mobile/lib/modules/settings/views/settings_page.dart b/mobile/lib/modules/settings/views/settings_page.dart index 0a1651de95..e717e0633a 100644 --- a/mobile/lib/modules/settings/views/settings_page.dart +++ b/mobile/lib/modules/settings/views/settings_page.dart @@ -1,3 +1,4 @@ +import 'package:auto_route/auto_route.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; @@ -9,6 +10,7 @@ import 'package:immich_mobile/modules/settings/ui/image_viewer_quality_setting/i import 'package:immich_mobile/modules/settings/ui/notification_setting/notification_setting.dart'; import 'package:immich_mobile/modules/settings/ui/theme_setting/theme_setting.dart'; +@RoutePage() class SettingsPage extends HookConsumerWidget { const SettingsPage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/shared_link/views/shared_link_edit_page.dart b/mobile/lib/modules/shared_link/views/shared_link_edit_page.dart index 87a2822dec..288fdae338 100644 --- a/mobile/lib/modules/shared_link/views/shared_link_edit_page.dart +++ b/mobile/lib/modules/shared_link/views/shared_link_edit_page.dart @@ -13,6 +13,7 @@ import 'package:immich_mobile/shared/providers/server_info.provider.dart'; import 'package:immich_mobile/shared/ui/immich_toast.dart'; import 'package:immich_mobile/utils/url_helper.dart'; +@RoutePage() class SharedLinkEditPage extends HookConsumerWidget { final SharedLink? existingLink; final List? assetsList; diff --git a/mobile/lib/modules/shared_link/views/shared_link_page.dart b/mobile/lib/modules/shared_link/views/shared_link_page.dart index 7638441b17..48b1b257e1 100644 --- a/mobile/lib/modules/shared_link/views/shared_link_page.dart +++ b/mobile/lib/modules/shared_link/views/shared_link_page.dart @@ -1,3 +1,4 @@ +import 'package:auto_route/auto_route.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; @@ -8,6 +9,7 @@ import 'package:immich_mobile/modules/shared_link/models/shared_link.dart'; import 'package:immich_mobile/modules/shared_link/providers/shared_link.provider.dart'; import 'package:immich_mobile/modules/shared_link/ui/shared_link_item.dart'; +@RoutePage() class SharedLinkPage extends HookConsumerWidget { const SharedLinkPage({Key? key}) : super(key: key); diff --git a/mobile/lib/modules/trash/views/trash_page.dart b/mobile/lib/modules/trash/views/trash_page.dart index 852b6e075c..46cd325f0c 100644 --- a/mobile/lib/modules/trash/views/trash_page.dart +++ b/mobile/lib/modules/trash/views/trash_page.dart @@ -16,6 +16,7 @@ import 'package:immich_mobile/shared/ui/confirm_dialog.dart'; import 'package:immich_mobile/shared/ui/immich_toast.dart'; import 'package:immich_mobile/shared/views/immich_loading_overlay.dart'; +@RoutePage() class TrashPage extends HookConsumerWidget { const TrashPage({super.key}); diff --git a/mobile/lib/routing/router.dart b/mobile/lib/routing/router.dart index 038525e213..6da526b9b5 100644 --- a/mobile/lib/routing/router.dart +++ b/mobile/lib/routing/router.dart @@ -64,137 +64,164 @@ import 'package:photo_manager/photo_manager.dart' hide LatLng; part 'router.gr.dart'; -@MaterialAutoRouter( - replaceInRouteName: 'Page,Route', - routes: [ - AutoRoute(page: SplashScreenPage, initial: true), +@AutoRouterConfig(replaceInRouteName: 'Page,Route') +class AppRouter extends _$AppRouter { + late final AuthGuard _authGuard; + late final DuplicateGuard _duplicateGuard; + late final BackupPermissionGuard _backupPermissionGuard; + + AppRouter( + ApiService apiService, + GalleryPermissionNotifier galleryPermissionNotifier, + ) { + _authGuard = AuthGuard(apiService); + _duplicateGuard = DuplicateGuard(); + _backupPermissionGuard = BackupPermissionGuard(galleryPermissionNotifier); + } + + @override + RouteType get defaultRouteType => const RouteType.material(); + + @override + late final List routes = [ + AutoRoute(page: SplashScreenRoute.page, initial: true), AutoRoute( - page: PermissionOnboardingPage, - guards: [AuthGuard, DuplicateGuard], + page: PermissionOnboardingRoute.page, + guards: [_authGuard, _duplicateGuard], ), - AutoRoute( - page: LoginPage, - guards: [ - DuplicateGuard, - ], - ), - AutoRoute(page: ChangePasswordPage), + AutoRoute(page: LoginRoute.page, guards: [_duplicateGuard]), + AutoRoute(page: ChangePasswordRoute.page), CustomRoute( - page: TabControllerPage, - guards: [AuthGuard, DuplicateGuard], + page: TabControllerRoute.page, + guards: [_authGuard, _duplicateGuard], children: [ - AutoRoute(page: HomePage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: SearchPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: SharingPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: LibraryPage, guards: [AuthGuard, DuplicateGuard]), + AutoRoute(page: HomeRoute.page, guards: [_authGuard, _duplicateGuard]), + AutoRoute( + page: SearchRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute( + page: SharingRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute( + page: LibraryRoute.page, + guards: [_authGuard, _duplicateGuard], + ), ], transitionsBuilder: TransitionsBuilders.fadeIn, ), CustomRoute( - page: GalleryViewerPage, - guards: [AuthGuard, DuplicateGuard], + page: GalleryViewerRoute.page, + guards: [_authGuard, _duplicateGuard], transitionsBuilder: CustomTransitionsBuilders.zoomedPage, ), - AutoRoute(page: VideoViewerPage, guards: [AuthGuard, DuplicateGuard]), AutoRoute( - page: BackupControllerPage, - guards: [AuthGuard, DuplicateGuard, BackupPermissionGuard], - ), - AutoRoute(page: SearchResultPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: CuratedLocationPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: CreateAlbumPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: FavoritesPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: AllVideosPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: AllMotionPhotosPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute( - page: RecentlyAddedPage, - guards: [AuthGuard, DuplicateGuard], - ), - CustomRoute( - page: AssetSelectionPage, - guards: [AuthGuard, DuplicateGuard], - transitionsBuilder: TransitionsBuilders.slideBottom, - ), - CustomRoute>( - page: SelectUserForSharingPage, - guards: [AuthGuard, DuplicateGuard], - transitionsBuilder: TransitionsBuilders.slideBottom, - ), - AutoRoute(page: AlbumViewerPage, guards: [AuthGuard, DuplicateGuard]), - CustomRoute?>( - page: SelectAdditionalUserForSharingPage, - guards: [AuthGuard, DuplicateGuard], - transitionsBuilder: TransitionsBuilders.slideBottom, + page: VideoViewerRoute.page, + guards: [_authGuard, _duplicateGuard], ), AutoRoute( - page: BackupAlbumSelectionPage, - guards: [AuthGuard, DuplicateGuard], + page: BackupControllerRoute.page, + guards: [_authGuard, _duplicateGuard, _backupPermissionGuard], + ), + AutoRoute( + page: SearchResultRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute( + page: CuratedLocationRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute( + page: CreateAlbumRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute(page: FavoritesRoute.page, guards: [_authGuard, _duplicateGuard]), + AutoRoute(page: AllVideosRoute.page, guards: [_authGuard, _duplicateGuard]), + AutoRoute( + page: AllMotionPhotosRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute( + page: RecentlyAddedRoute.page, + guards: [_authGuard, _duplicateGuard], ), - AutoRoute(page: AlbumPreviewPage, guards: [AuthGuard, DuplicateGuard]), CustomRoute( - page: FailedBackupStatusPage, - guards: [AuthGuard, DuplicateGuard], + page: AssetSelectionRoute.page, + guards: [_authGuard, _duplicateGuard], + transitionsBuilder: TransitionsBuilders.slideBottom, + ), + CustomRoute( + page: SelectUserForSharingRoute.page, + guards: [_authGuard, _duplicateGuard], transitionsBuilder: TransitionsBuilders.slideBottom, ), AutoRoute( - page: SettingsPage, - guards: [ - DuplicateGuard, - ], + page: AlbumViewerRoute.page, + guards: [_authGuard, _duplicateGuard], ), - AutoRoute(page: AppLogPage, guards: [DuplicateGuard]), - AutoRoute( - page: AppLogDetailPage, - ), - AutoRoute( - page: ArchivePage, - guards: [ - AuthGuard, - DuplicateGuard, - ], - ), - AutoRoute(page: PartnerPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: PartnerDetailPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute( - page: PersonResultPage, - guards: [ - AuthGuard, - DuplicateGuard, - ], - ), - AutoRoute(page: AllPeoplePage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: MemoryPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: MapPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: AlbumOptionsPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: TrashPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: SharedLinkPage, guards: [AuthGuard, DuplicateGuard]), - AutoRoute(page: SharedLinkEditPage, guards: [AuthGuard, DuplicateGuard]), CustomRoute( - page: ActivitiesPage, - guards: [AuthGuard, DuplicateGuard], + page: SelectAdditionalUserForSharingRoute.page, + guards: [_authGuard, _duplicateGuard], + transitionsBuilder: TransitionsBuilders.slideBottom, + ), + AutoRoute( + page: BackupAlbumSelectionRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute( + page: AlbumPreviewRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + CustomRoute( + page: FailedBackupStatusRoute.page, + guards: [_authGuard, _duplicateGuard], + transitionsBuilder: TransitionsBuilders.slideBottom, + ), + AutoRoute(page: SettingsRoute.page, guards: [_duplicateGuard]), + AutoRoute(page: AppLogRoute.page, guards: [_duplicateGuard]), + AutoRoute(page: AppLogDetailRoute.page, guards: [_duplicateGuard]), + AutoRoute(page: ArchiveRoute.page, guards: [_authGuard, _duplicateGuard]), + AutoRoute(page: PartnerRoute.page, guards: [_authGuard, _duplicateGuard]), + AutoRoute( + page: PartnerDetailRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute( + page: PersonResultRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute(page: AllPeopleRoute.page, guards: [_authGuard, _duplicateGuard]), + AutoRoute(page: MemoryRoute.page, guards: [_authGuard, _duplicateGuard]), + AutoRoute(page: MapRoute.page, guards: [_authGuard, _duplicateGuard]), + AutoRoute( + page: AlbumOptionsRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute(page: TrashRoute.page, guards: [_authGuard, _duplicateGuard]), + AutoRoute( + page: SharedLinkRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + AutoRoute( + page: SharedLinkEditRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + CustomRoute( + page: ActivitiesRoute.page, + guards: [_authGuard, _duplicateGuard], transitionsBuilder: TransitionsBuilders.slideLeft, durationInMilliseconds: 200, ), - CustomRoute( - page: MapLocationPickerPage, - guards: [AuthGuard, DuplicateGuard], + CustomRoute( + page: MapLocationPickerRoute.page, + guards: [_authGuard, _duplicateGuard], ), - AutoRoute(page: BackupOptionsPage, guards: [AuthGuard, DuplicateGuard]), - ], -) -class AppRouter extends _$AppRouter { - // ignore: unused_field - final ApiService _apiService; - - AppRouter( - this._apiService, - GalleryPermissionNotifier galleryPermissionNotifier, - ) : super( - authGuard: AuthGuard(_apiService), - duplicateGuard: DuplicateGuard(), - backupPermissionGuard: - BackupPermissionGuard(galleryPermissionNotifier), - ); + AutoRoute( + page: BackupOptionsRoute.page, + guards: [_authGuard, _duplicateGuard], + ), + ]; } final appRouterProvider = Provider( diff --git a/mobile/lib/routing/router.gr.dart b/mobile/lib/routing/router.gr.dart index 8e30770bb1..fa9db9e695 100644 --- a/mobile/lib/routing/router.gr.dart +++ b/mobile/lib/routing/router.gr.dart @@ -1,69 +1,164 @@ -// ************************************************************************** -// AutoRouteGenerator -// ************************************************************************** - // GENERATED CODE - DO NOT MODIFY BY HAND // ************************************************************************** -// AutoRouteGenerator +// AutoRouterGenerator // ************************************************************************** -// + // ignore_for_file: type=lint +// coverage:ignore-file part of 'router.dart'; -class _$AppRouter extends RootStackRouter { - _$AppRouter({ - GlobalKey? navigatorKey, - required this.authGuard, - required this.duplicateGuard, - required this.backupPermissionGuard, - }) : super(navigatorKey); - - final AuthGuard authGuard; - - final DuplicateGuard duplicateGuard; - - final BackupPermissionGuard backupPermissionGuard; +abstract class _$AppRouter extends RootStackRouter { + // ignore: unused_element + _$AppRouter({super.navigatorKey}); @override final Map pagesMap = { - SplashScreenRoute.name: (routeData) { - return MaterialPageX( + ActivitiesRoute.name: (routeData) { + return AutoRoutePage( routeData: routeData, - child: const SplashScreenPage(), + child: const ActivitiesPage(), ); }, - PermissionOnboardingRoute.name: (routeData) { - return MaterialPageX( + AlbumOptionsRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( routeData: routeData, - child: const PermissionOnboardingPage(), + child: AlbumOptionsPage( + key: args.key, + album: args.album, + ), ); }, - LoginRoute.name: (routeData) { - return MaterialPageX( + AlbumPreviewRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( routeData: routeData, - child: const LoginPage(), + child: AlbumPreviewPage( + key: args.key, + album: args.album, + ), + ); + }, + AlbumViewerRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: AlbumViewerPage( + key: args.key, + albumId: args.albumId, + ), + ); + }, + AllMotionPhotosRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const AllMotionPhotosPage(), + ); + }, + AllPeopleRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const AllPeoplePage(), + ); + }, + AllVideosRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const AllVideosPage(), + ); + }, + AppLogDetailRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: AppLogDetailPage( + key: args.key, + logMessage: args.logMessage, + ), + ); + }, + AppLogRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const AppLogPage(), + ); + }, + ArchiveRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const ArchivePage(), + ); + }, + AssetSelectionRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: AssetSelectionPage( + key: args.key, + existingAssets: args.existingAssets, + canDeselect: args.canDeselect, + query: args.query, + ), + ); + }, + BackupAlbumSelectionRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const BackupAlbumSelectionPage(), + ); + }, + BackupControllerRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const BackupControllerPage(), + ); + }, + BackupOptionsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const BackupOptionsPage(), ); }, ChangePasswordRoute.name: (routeData) { - return MaterialPageX( + return AutoRoutePage( routeData: routeData, child: const ChangePasswordPage(), ); }, - TabControllerRoute.name: (routeData) { - return CustomPage( + CreateAlbumRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( routeData: routeData, - child: const TabControllerPage(), - transitionsBuilder: TransitionsBuilders.fadeIn, - opaque: true, - barrierDismissible: false, + child: CreateAlbumPage( + key: args.key, + isSharedAlbum: args.isSharedAlbum, + initialAssets: args.initialAssets, + ), + ); + }, + CuratedLocationRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const CuratedLocationPage(), + ); + }, + FailedBackupStatusRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const FailedBackupStatusPage(), + ); + }, + FavoritesRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const FavoritesPage(), ); }, GalleryViewerRoute.name: (routeData) { final args = routeData.argsAs(); - return CustomPage( + return AutoRoutePage( routeData: routeData, child: GalleryViewerPage( key: args.key, @@ -73,14 +168,183 @@ class _$AppRouter extends RootStackRouter { heroOffset: args.heroOffset, showStack: args.showStack, ), - transitionsBuilder: CustomTransitionsBuilders.zoomedPage, - opaque: true, - barrierDismissible: false, + ); + }, + HomeRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const HomePage(), + ); + }, + LibraryRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const LibraryPage(), + ); + }, + LoginRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const LoginPage(), + ); + }, + MapLocationPickerRoute.name: (routeData) { + final args = routeData.argsAs( + orElse: () => const MapLocationPickerRouteArgs()); + return AutoRoutePage( + routeData: routeData, + child: MapLocationPickerPage( + key: args.key, + initialLatLng: args.initialLatLng, + ), + ); + }, + MapRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const MapPage(), + ); + }, + MemoryRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: MemoryPage( + memories: args.memories, + memoryIndex: args.memoryIndex, + key: args.key, + ), + ); + }, + PartnerDetailRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: PartnerDetailPage( + key: args.key, + partner: args.partner, + ), + ); + }, + PartnerRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const PartnerPage(), + ); + }, + PermissionOnboardingRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const PermissionOnboardingPage(), + ); + }, + PersonResultRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: PersonResultPage( + key: args.key, + personId: args.personId, + personName: args.personName, + ), + ); + }, + RecentlyAddedRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const RecentlyAddedPage(), + ); + }, + SearchRoute.name: (routeData) { + final args = routeData.argsAs( + orElse: () => const SearchRouteArgs()); + return AutoRoutePage( + routeData: routeData, + child: SearchPage(key: args.key), + ); + }, + SearchResultRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage( + routeData: routeData, + child: SearchResultPage( + key: args.key, + searchTerm: args.searchTerm, + ), + ); + }, + SelectAdditionalUserForSharingRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage?>( + routeData: routeData, + child: SelectAdditionalUserForSharingPage( + key: args.key, + album: args.album, + ), + ); + }, + SelectUserForSharingRoute.name: (routeData) { + final args = routeData.argsAs(); + return AutoRoutePage>( + routeData: routeData, + child: SelectUserForSharingPage( + key: args.key, + assets: args.assets, + ), + ); + }, + SettingsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const SettingsPage(), + ); + }, + SharedLinkEditRoute.name: (routeData) { + final args = routeData.argsAs( + orElse: () => const SharedLinkEditRouteArgs()); + return AutoRoutePage( + routeData: routeData, + child: SharedLinkEditPage( + key: args.key, + existingLink: args.existingLink, + assetsList: args.assetsList, + albumId: args.albumId, + ), + ); + }, + SharedLinkRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const SharedLinkPage(), + ); + }, + SharingRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const SharingPage(), + ); + }, + SplashScreenRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const SplashScreenPage(), + ); + }, + TabControllerRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const TabControllerPage(), + ); + }, + TrashRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const TrashPage(), ); }, VideoViewerRoute.name: (routeData) { final args = routeData.argsAs(); - return MaterialPageX( + return AutoRoutePage( routeData: routeData, child: VideoViewerPage( key: args.key, @@ -93,703 +357,432 @@ class _$AppRouter extends RootStackRouter { ), ); }, - BackupControllerRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const BackupControllerPage(), - ); - }, - SearchResultRoute.name: (routeData) { - final args = routeData.argsAs(); - return MaterialPageX( - routeData: routeData, - child: SearchResultPage( - key: args.key, - searchTerm: args.searchTerm, - ), - ); - }, - CuratedLocationRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const CuratedLocationPage(), - ); - }, - CreateAlbumRoute.name: (routeData) { - final args = routeData.argsAs(); - return MaterialPageX( - routeData: routeData, - child: CreateAlbumPage( - key: args.key, - isSharedAlbum: args.isSharedAlbum, - initialAssets: args.initialAssets, - ), - ); - }, - FavoritesRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const FavoritesPage(), - ); - }, - AllVideosRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const AllVideosPage(), - ); - }, - AllMotionPhotosRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const AllMotionPhotosPage(), - ); - }, - RecentlyAddedRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const RecentlyAddedPage(), - ); - }, - AssetSelectionRoute.name: (routeData) { - final args = routeData.argsAs(); - return CustomPage( - routeData: routeData, - child: AssetSelectionPage( - key: args.key, - existingAssets: args.existingAssets, - canDeselect: args.canDeselect, - query: args.query, - ), - transitionsBuilder: TransitionsBuilders.slideBottom, - opaque: true, - barrierDismissible: false, - ); - }, - SelectUserForSharingRoute.name: (routeData) { - final args = routeData.argsAs(); - return CustomPage>( - routeData: routeData, - child: SelectUserForSharingPage( - key: args.key, - assets: args.assets, - ), - transitionsBuilder: TransitionsBuilders.slideBottom, - opaque: true, - barrierDismissible: false, - ); - }, - AlbumViewerRoute.name: (routeData) { - final args = routeData.argsAs(); - return MaterialPageX( - routeData: routeData, - child: AlbumViewerPage( - key: args.key, - albumId: args.albumId, - ), - ); - }, - SelectAdditionalUserForSharingRoute.name: (routeData) { - final args = routeData.argsAs(); - return CustomPage?>( - routeData: routeData, - child: SelectAdditionalUserForSharingPage( - key: args.key, - album: args.album, - ), - transitionsBuilder: TransitionsBuilders.slideBottom, - opaque: true, - barrierDismissible: false, - ); - }, - BackupAlbumSelectionRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const BackupAlbumSelectionPage(), - ); - }, - AlbumPreviewRoute.name: (routeData) { - final args = routeData.argsAs(); - return MaterialPageX( - routeData: routeData, - child: AlbumPreviewPage( - key: args.key, - album: args.album, - ), - ); - }, - FailedBackupStatusRoute.name: (routeData) { - return CustomPage( - routeData: routeData, - child: const FailedBackupStatusPage(), - transitionsBuilder: TransitionsBuilders.slideBottom, - opaque: true, - barrierDismissible: false, - ); - }, - SettingsRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const SettingsPage(), - ); - }, - AppLogRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const AppLogPage(), - ); - }, - AppLogDetailRoute.name: (routeData) { - final args = routeData.argsAs(); - return MaterialPageX( - routeData: routeData, - child: AppLogDetailPage( - key: args.key, - logMessage: args.logMessage, - ), - ); - }, - ArchiveRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const ArchivePage(), - ); - }, - PartnerRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const PartnerPage(), - ); - }, - PartnerDetailRoute.name: (routeData) { - final args = routeData.argsAs(); - return MaterialPageX( - routeData: routeData, - child: PartnerDetailPage( - key: args.key, - partner: args.partner, - ), - ); - }, - PersonResultRoute.name: (routeData) { - final args = routeData.argsAs(); - return MaterialPageX( - routeData: routeData, - child: PersonResultPage( - key: args.key, - personId: args.personId, - personName: args.personName, - ), - ); - }, - AllPeopleRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const AllPeoplePage(), - ); - }, - MemoryRoute.name: (routeData) { - final args = routeData.argsAs(); - return MaterialPageX( - routeData: routeData, - child: MemoryPage( - memories: args.memories, - memoryIndex: args.memoryIndex, - key: args.key, - ), - ); - }, - MapRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const MapPage(), - ); - }, - AlbumOptionsRoute.name: (routeData) { - final args = routeData.argsAs(); - return MaterialPageX( - routeData: routeData, - child: AlbumOptionsPage( - key: args.key, - album: args.album, - ), - ); - }, - TrashRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const TrashPage(), - ); - }, - SharedLinkRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const SharedLinkPage(), - ); - }, - SharedLinkEditRoute.name: (routeData) { - final args = routeData.argsAs( - orElse: () => const SharedLinkEditRouteArgs()); - return MaterialPageX( - routeData: routeData, - child: SharedLinkEditPage( - key: args.key, - existingLink: args.existingLink, - assetsList: args.assetsList, - albumId: args.albumId, - ), - ); - }, - ActivitiesRoute.name: (routeData) { - return CustomPage( - routeData: routeData, - child: const ActivitiesPage(), - transitionsBuilder: TransitionsBuilders.slideLeft, - durationInMilliseconds: 200, - opaque: true, - barrierDismissible: false, - ); - }, - MapLocationPickerRoute.name: (routeData) { - final args = routeData.argsAs( - orElse: () => const MapLocationPickerRouteArgs()); - return CustomPage( - routeData: routeData, - child: MapLocationPickerPage( - key: args.key, - initialLatLng: args.initialLatLng, - ), - opaque: true, - barrierDismissible: false, - ); - }, - BackupOptionsRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const BackupOptionsPage(), - ); - }, - HomeRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const HomePage(), - ); - }, - SearchRoute.name: (routeData) { - final args = routeData.argsAs( - orElse: () => const SearchRouteArgs()); - return MaterialPageX( - routeData: routeData, - child: SearchPage(key: args.key), - ); - }, - SharingRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const SharingPage(), - ); - }, - LibraryRoute.name: (routeData) { - return MaterialPageX( - routeData: routeData, - child: const LibraryPage(), - ); - }, }; +} + +/// generated route for +/// [ActivitiesPage] +class ActivitiesRoute extends PageRouteInfo { + const ActivitiesRoute({List? children}) + : super( + ActivitiesRoute.name, + initialChildren: children, + ); + + static const String name = 'ActivitiesRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [AlbumOptionsPage] +class AlbumOptionsRoute extends PageRouteInfo { + AlbumOptionsRoute({ + Key? key, + required Album album, + List? children, + }) : super( + AlbumOptionsRoute.name, + args: AlbumOptionsRouteArgs( + key: key, + album: album, + ), + initialChildren: children, + ); + + static const String name = 'AlbumOptionsRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class AlbumOptionsRouteArgs { + const AlbumOptionsRouteArgs({ + this.key, + required this.album, + }); + + final Key? key; + + final Album album; @override - List get routes => [ - RouteConfig( - SplashScreenRoute.name, - path: '/', - ), - RouteConfig( - PermissionOnboardingRoute.name, - path: '/permission-onboarding-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - LoginRoute.name, - path: '/login-page', - guards: [duplicateGuard], - ), - RouteConfig( - ChangePasswordRoute.name, - path: '/change-password-page', - ), - RouteConfig( - TabControllerRoute.name, - path: '/tab-controller-page', - guards: [ - authGuard, - duplicateGuard, - ], - children: [ - RouteConfig( - HomeRoute.name, - path: 'home-page', - parent: TabControllerRoute.name, - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - SearchRoute.name, - path: 'search-page', - parent: TabControllerRoute.name, - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - SharingRoute.name, - path: 'sharing-page', - parent: TabControllerRoute.name, - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - LibraryRoute.name, - path: 'library-page', - parent: TabControllerRoute.name, - guards: [ - authGuard, - duplicateGuard, - ], - ), - ], - ), - RouteConfig( - GalleryViewerRoute.name, - path: '/gallery-viewer-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - VideoViewerRoute.name, - path: '/video-viewer-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - BackupControllerRoute.name, - path: '/backup-controller-page', - guards: [ - authGuard, - duplicateGuard, - backupPermissionGuard, - ], - ), - RouteConfig( - SearchResultRoute.name, - path: '/search-result-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - CuratedLocationRoute.name, - path: '/curated-location-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - CreateAlbumRoute.name, - path: '/create-album-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - FavoritesRoute.name, - path: '/favorites-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - AllVideosRoute.name, - path: '/all-videos-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - AllMotionPhotosRoute.name, - path: '/all-motion-photos-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - RecentlyAddedRoute.name, - path: '/recently-added-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - AssetSelectionRoute.name, - path: '/asset-selection-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - SelectUserForSharingRoute.name, - path: '/select-user-for-sharing-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - AlbumViewerRoute.name, - path: '/album-viewer-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - SelectAdditionalUserForSharingRoute.name, - path: '/select-additional-user-for-sharing-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - BackupAlbumSelectionRoute.name, - path: '/backup-album-selection-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( + String toString() { + return 'AlbumOptionsRouteArgs{key: $key, album: $album}'; + } +} + +/// generated route for +/// [AlbumPreviewPage] +class AlbumPreviewRoute extends PageRouteInfo { + AlbumPreviewRoute({ + Key? key, + required AssetPathEntity album, + List? children, + }) : super( AlbumPreviewRoute.name, - path: '/album-preview-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - FailedBackupStatusRoute.name, - path: '/failed-backup-status-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - SettingsRoute.name, - path: '/settings-page', - guards: [duplicateGuard], - ), - RouteConfig( - AppLogRoute.name, - path: '/app-log-page', - guards: [duplicateGuard], - ), - RouteConfig( - AppLogDetailRoute.name, - path: '/app-log-detail-page', - ), - RouteConfig( - ArchiveRoute.name, - path: '/archive-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - PartnerRoute.name, - path: '/partner-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - PartnerDetailRoute.name, - path: '/partner-detail-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - PersonResultRoute.name, - path: '/person-result-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( + args: AlbumPreviewRouteArgs( + key: key, + album: album, + ), + initialChildren: children, + ); + + static const String name = 'AlbumPreviewRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class AlbumPreviewRouteArgs { + const AlbumPreviewRouteArgs({ + this.key, + required this.album, + }); + + final Key? key; + + final AssetPathEntity album; + + @override + String toString() { + return 'AlbumPreviewRouteArgs{key: $key, album: $album}'; + } +} + +/// generated route for +/// [AlbumViewerPage] +class AlbumViewerRoute extends PageRouteInfo { + AlbumViewerRoute({ + Key? key, + required int albumId, + List? children, + }) : super( + AlbumViewerRoute.name, + args: AlbumViewerRouteArgs( + key: key, + albumId: albumId, + ), + initialChildren: children, + ); + + static const String name = 'AlbumViewerRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class AlbumViewerRouteArgs { + const AlbumViewerRouteArgs({ + this.key, + required this.albumId, + }); + + final Key? key; + + final int albumId; + + @override + String toString() { + return 'AlbumViewerRouteArgs{key: $key, albumId: $albumId}'; + } +} + +/// generated route for +/// [AllMotionPhotosPage] +class AllMotionPhotosRoute extends PageRouteInfo { + const AllMotionPhotosRoute({List? children}) + : super( + AllMotionPhotosRoute.name, + initialChildren: children, + ); + + static const String name = 'AllMotionPhotosRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [AllPeoplePage] +class AllPeopleRoute extends PageRouteInfo { + const AllPeopleRoute({List? children}) + : super( AllPeopleRoute.name, - path: '/all-people-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - MemoryRoute.name, - path: '/memory-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - MapRoute.name, - path: '/map-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - AlbumOptionsRoute.name, - path: '/album-options-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - TrashRoute.name, - path: '/trash-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - SharedLinkRoute.name, - path: '/shared-link-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - SharedLinkEditRoute.name, - path: '/shared-link-edit-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - ActivitiesRoute.name, - path: '/activities-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( - MapLocationPickerRoute.name, - path: '/map-location-picker-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - RouteConfig( + initialChildren: children, + ); + + static const String name = 'AllPeopleRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [AllVideosPage] +class AllVideosRoute extends PageRouteInfo { + const AllVideosRoute({List? children}) + : super( + AllVideosRoute.name, + initialChildren: children, + ); + + static const String name = 'AllVideosRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [AppLogDetailPage] +class AppLogDetailRoute extends PageRouteInfo { + AppLogDetailRoute({ + Key? key, + required LoggerMessage logMessage, + List? children, + }) : super( + AppLogDetailRoute.name, + args: AppLogDetailRouteArgs( + key: key, + logMessage: logMessage, + ), + initialChildren: children, + ); + + static const String name = 'AppLogDetailRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class AppLogDetailRouteArgs { + const AppLogDetailRouteArgs({ + this.key, + required this.logMessage, + }); + + final Key? key; + + final LoggerMessage logMessage; + + @override + String toString() { + return 'AppLogDetailRouteArgs{key: $key, logMessage: $logMessage}'; + } +} + +/// generated route for +/// [AppLogPage] +class AppLogRoute extends PageRouteInfo { + const AppLogRoute({List? children}) + : super( + AppLogRoute.name, + initialChildren: children, + ); + + static const String name = 'AppLogRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [ArchivePage] +class ArchiveRoute extends PageRouteInfo { + const ArchiveRoute({List? children}) + : super( + ArchiveRoute.name, + initialChildren: children, + ); + + static const String name = 'ArchiveRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [AssetSelectionPage] +class AssetSelectionRoute extends PageRouteInfo { + AssetSelectionRoute({ + Key? key, + required Set existingAssets, + bool canDeselect = false, + required QueryBuilder? query, + List? children, + }) : super( + AssetSelectionRoute.name, + args: AssetSelectionRouteArgs( + key: key, + existingAssets: existingAssets, + canDeselect: canDeselect, + query: query, + ), + initialChildren: children, + ); + + static const String name = 'AssetSelectionRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class AssetSelectionRouteArgs { + const AssetSelectionRouteArgs({ + this.key, + required this.existingAssets, + this.canDeselect = false, + required this.query, + }); + + final Key? key; + + final Set existingAssets; + + final bool canDeselect; + + final QueryBuilder? query; + + @override + String toString() { + return 'AssetSelectionRouteArgs{key: $key, existingAssets: $existingAssets, canDeselect: $canDeselect, query: $query}'; + } +} + +/// generated route for +/// [BackupAlbumSelectionPage] +class BackupAlbumSelectionRoute extends PageRouteInfo { + const BackupAlbumSelectionRoute({List? children}) + : super( + BackupAlbumSelectionRoute.name, + initialChildren: children, + ); + + static const String name = 'BackupAlbumSelectionRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [BackupControllerPage] +class BackupControllerRoute extends PageRouteInfo { + const BackupControllerRoute({List? children}) + : super( + BackupControllerRoute.name, + initialChildren: children, + ); + + static const String name = 'BackupControllerRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [BackupOptionsPage] +class BackupOptionsRoute extends PageRouteInfo { + const BackupOptionsRoute({List? children}) + : super( BackupOptionsRoute.name, - path: '/backup-options-page', - guards: [ - authGuard, - duplicateGuard, - ], - ), - ]; -} - -/// generated route for -/// [SplashScreenPage] -class SplashScreenRoute extends PageRouteInfo { - const SplashScreenRoute() - : super( - SplashScreenRoute.name, - path: '/', + initialChildren: children, ); - static const String name = 'SplashScreenRoute'; -} + static const String name = 'BackupOptionsRoute'; -/// generated route for -/// [PermissionOnboardingPage] -class PermissionOnboardingRoute extends PageRouteInfo { - const PermissionOnboardingRoute() - : super( - PermissionOnboardingRoute.name, - path: '/permission-onboarding-page', - ); - - static const String name = 'PermissionOnboardingRoute'; -} - -/// generated route for -/// [LoginPage] -class LoginRoute extends PageRouteInfo { - const LoginRoute() - : super( - LoginRoute.name, - path: '/login-page', - ); - - static const String name = 'LoginRoute'; + static const PageInfo page = PageInfo(name); } /// generated route for /// [ChangePasswordPage] class ChangePasswordRoute extends PageRouteInfo { - const ChangePasswordRoute() + const ChangePasswordRoute({List? children}) : super( ChangePasswordRoute.name, - path: '/change-password-page', - ); - - static const String name = 'ChangePasswordRoute'; -} - -/// generated route for -/// [TabControllerPage] -class TabControllerRoute extends PageRouteInfo { - const TabControllerRoute({List? children}) - : super( - TabControllerRoute.name, - path: '/tab-controller-page', initialChildren: children, ); - static const String name = 'TabControllerRoute'; + static const String name = 'ChangePasswordRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [CreateAlbumPage] +class CreateAlbumRoute extends PageRouteInfo { + CreateAlbumRoute({ + Key? key, + required bool isSharedAlbum, + List? initialAssets, + List? children, + }) : super( + CreateAlbumRoute.name, + args: CreateAlbumRouteArgs( + key: key, + isSharedAlbum: isSharedAlbum, + initialAssets: initialAssets, + ), + initialChildren: children, + ); + + static const String name = 'CreateAlbumRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class CreateAlbumRouteArgs { + const CreateAlbumRouteArgs({ + this.key, + required this.isSharedAlbum, + this.initialAssets, + }); + + final Key? key; + + final bool isSharedAlbum; + + final List? initialAssets; + + @override + String toString() { + return 'CreateAlbumRouteArgs{key: $key, isSharedAlbum: $isSharedAlbum, initialAssets: $initialAssets}'; + } +} + +/// generated route for +/// [CuratedLocationPage] +class CuratedLocationRoute extends PageRouteInfo { + const CuratedLocationRoute({List? children}) + : super( + CuratedLocationRoute.name, + initialChildren: children, + ); + + static const String name = 'CuratedLocationRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [FailedBackupStatusPage] +class FailedBackupStatusRoute extends PageRouteInfo { + const FailedBackupStatusRoute({List? children}) + : super( + FailedBackupStatusRoute.name, + initialChildren: children, + ); + + static const String name = 'FailedBackupStatusRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [FavoritesPage] +class FavoritesRoute extends PageRouteInfo { + const FavoritesRoute({List? children}) + : super( + FavoritesRoute.name, + initialChildren: children, + ); + + static const String name = 'FavoritesRoute'; + + static const PageInfo page = PageInfo(name); } /// generated route for @@ -802,9 +795,9 @@ class GalleryViewerRoute extends PageRouteInfo { required int totalAssets, int heroOffset = 0, bool showStack = false, + List? children, }) : super( GalleryViewerRoute.name, - path: '/gallery-viewer-page', args: GalleryViewerRouteArgs( key: key, initialIndex: initialIndex, @@ -813,9 +806,13 @@ class GalleryViewerRoute extends PageRouteInfo { heroOffset: heroOffset, showStack: showStack, ), + initialChildren: children, ); static const String name = 'GalleryViewerRoute'; + + static const PageInfo page = + PageInfo(name); } class GalleryViewerRouteArgs { @@ -846,6 +843,541 @@ class GalleryViewerRouteArgs { } } +/// generated route for +/// [HomePage] +class HomeRoute extends PageRouteInfo { + const HomeRoute({List? children}) + : super( + HomeRoute.name, + initialChildren: children, + ); + + static const String name = 'HomeRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [LibraryPage] +class LibraryRoute extends PageRouteInfo { + const LibraryRoute({List? children}) + : super( + LibraryRoute.name, + initialChildren: children, + ); + + static const String name = 'LibraryRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [LoginPage] +class LoginRoute extends PageRouteInfo { + const LoginRoute({List? children}) + : super( + LoginRoute.name, + initialChildren: children, + ); + + static const String name = 'LoginRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [MapLocationPickerPage] +class MapLocationPickerRoute extends PageRouteInfo { + MapLocationPickerRoute({ + Key? key, + LatLng initialLatLng = const LatLng(0, 0), + List? children, + }) : super( + MapLocationPickerRoute.name, + args: MapLocationPickerRouteArgs( + key: key, + initialLatLng: initialLatLng, + ), + initialChildren: children, + ); + + static const String name = 'MapLocationPickerRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class MapLocationPickerRouteArgs { + const MapLocationPickerRouteArgs({ + this.key, + this.initialLatLng = const LatLng(0, 0), + }); + + final Key? key; + + final LatLng initialLatLng; + + @override + String toString() { + return 'MapLocationPickerRouteArgs{key: $key, initialLatLng: $initialLatLng}'; + } +} + +/// generated route for +/// [MapPage] +class MapRoute extends PageRouteInfo { + const MapRoute({List? children}) + : super( + MapRoute.name, + initialChildren: children, + ); + + static const String name = 'MapRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [MemoryPage] +class MemoryRoute extends PageRouteInfo { + MemoryRoute({ + required List memories, + required int memoryIndex, + Key? key, + List? children, + }) : super( + MemoryRoute.name, + args: MemoryRouteArgs( + memories: memories, + memoryIndex: memoryIndex, + key: key, + ), + initialChildren: children, + ); + + static const String name = 'MemoryRoute'; + + static const PageInfo page = PageInfo(name); +} + +class MemoryRouteArgs { + const MemoryRouteArgs({ + required this.memories, + required this.memoryIndex, + this.key, + }); + + final List memories; + + final int memoryIndex; + + final Key? key; + + @override + String toString() { + return 'MemoryRouteArgs{memories: $memories, memoryIndex: $memoryIndex, key: $key}'; + } +} + +/// generated route for +/// [PartnerDetailPage] +class PartnerDetailRoute extends PageRouteInfo { + PartnerDetailRoute({ + Key? key, + required User partner, + List? children, + }) : super( + PartnerDetailRoute.name, + args: PartnerDetailRouteArgs( + key: key, + partner: partner, + ), + initialChildren: children, + ); + + static const String name = 'PartnerDetailRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class PartnerDetailRouteArgs { + const PartnerDetailRouteArgs({ + this.key, + required this.partner, + }); + + final Key? key; + + final User partner; + + @override + String toString() { + return 'PartnerDetailRouteArgs{key: $key, partner: $partner}'; + } +} + +/// generated route for +/// [PartnerPage] +class PartnerRoute extends PageRouteInfo { + const PartnerRoute({List? children}) + : super( + PartnerRoute.name, + initialChildren: children, + ); + + static const String name = 'PartnerRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [PermissionOnboardingPage] +class PermissionOnboardingRoute extends PageRouteInfo { + const PermissionOnboardingRoute({List? children}) + : super( + PermissionOnboardingRoute.name, + initialChildren: children, + ); + + static const String name = 'PermissionOnboardingRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [PersonResultPage] +class PersonResultRoute extends PageRouteInfo { + PersonResultRoute({ + Key? key, + required String personId, + required String personName, + List? children, + }) : super( + PersonResultRoute.name, + args: PersonResultRouteArgs( + key: key, + personId: personId, + personName: personName, + ), + initialChildren: children, + ); + + static const String name = 'PersonResultRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class PersonResultRouteArgs { + const PersonResultRouteArgs({ + this.key, + required this.personId, + required this.personName, + }); + + final Key? key; + + final String personId; + + final String personName; + + @override + String toString() { + return 'PersonResultRouteArgs{key: $key, personId: $personId, personName: $personName}'; + } +} + +/// generated route for +/// [RecentlyAddedPage] +class RecentlyAddedRoute extends PageRouteInfo { + const RecentlyAddedRoute({List? children}) + : super( + RecentlyAddedRoute.name, + initialChildren: children, + ); + + static const String name = 'RecentlyAddedRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [SearchPage] +class SearchRoute extends PageRouteInfo { + SearchRoute({ + Key? key, + List? children, + }) : super( + SearchRoute.name, + args: SearchRouteArgs(key: key), + initialChildren: children, + ); + + static const String name = 'SearchRoute'; + + static const PageInfo page = PageInfo(name); +} + +class SearchRouteArgs { + const SearchRouteArgs({this.key}); + + final Key? key; + + @override + String toString() { + return 'SearchRouteArgs{key: $key}'; + } +} + +/// generated route for +/// [SearchResultPage] +class SearchResultRoute extends PageRouteInfo { + SearchResultRoute({ + Key? key, + required String searchTerm, + List? children, + }) : super( + SearchResultRoute.name, + args: SearchResultRouteArgs( + key: key, + searchTerm: searchTerm, + ), + initialChildren: children, + ); + + static const String name = 'SearchResultRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class SearchResultRouteArgs { + const SearchResultRouteArgs({ + this.key, + required this.searchTerm, + }); + + final Key? key; + + final String searchTerm; + + @override + String toString() { + return 'SearchResultRouteArgs{key: $key, searchTerm: $searchTerm}'; + } +} + +/// generated route for +/// [SelectAdditionalUserForSharingPage] +class SelectAdditionalUserForSharingRoute + extends PageRouteInfo { + SelectAdditionalUserForSharingRoute({ + Key? key, + required Album album, + List? children, + }) : super( + SelectAdditionalUserForSharingRoute.name, + args: SelectAdditionalUserForSharingRouteArgs( + key: key, + album: album, + ), + initialChildren: children, + ); + + static const String name = 'SelectAdditionalUserForSharingRoute'; + + static const PageInfo page = + PageInfo(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 +/// [SelectUserForSharingPage] +class SelectUserForSharingRoute + extends PageRouteInfo { + SelectUserForSharingRoute({ + Key? key, + required Set assets, + List? children, + }) : super( + SelectUserForSharingRoute.name, + args: SelectUserForSharingRouteArgs( + key: key, + assets: assets, + ), + initialChildren: children, + ); + + static const String name = 'SelectUserForSharingRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class SelectUserForSharingRouteArgs { + const SelectUserForSharingRouteArgs({ + this.key, + required this.assets, + }); + + final Key? key; + + final Set assets; + + @override + String toString() { + return 'SelectUserForSharingRouteArgs{key: $key, assets: $assets}'; + } +} + +/// generated route for +/// [SettingsPage] +class SettingsRoute extends PageRouteInfo { + const SettingsRoute({List? children}) + : super( + SettingsRoute.name, + initialChildren: children, + ); + + static const String name = 'SettingsRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [SharedLinkEditPage] +class SharedLinkEditRoute extends PageRouteInfo { + SharedLinkEditRoute({ + Key? key, + SharedLink? existingLink, + List? assetsList, + String? albumId, + List? children, + }) : super( + SharedLinkEditRoute.name, + args: SharedLinkEditRouteArgs( + key: key, + existingLink: existingLink, + assetsList: assetsList, + albumId: albumId, + ), + initialChildren: children, + ); + + static const String name = 'SharedLinkEditRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class SharedLinkEditRouteArgs { + const SharedLinkEditRouteArgs({ + this.key, + this.existingLink, + this.assetsList, + this.albumId, + }); + + final Key? key; + + final SharedLink? existingLink; + + final List? assetsList; + + final String? albumId; + + @override + String toString() { + return 'SharedLinkEditRouteArgs{key: $key, existingLink: $existingLink, assetsList: $assetsList, albumId: $albumId}'; + } +} + +/// generated route for +/// [SharedLinkPage] +class SharedLinkRoute extends PageRouteInfo { + const SharedLinkRoute({List? children}) + : super( + SharedLinkRoute.name, + initialChildren: children, + ); + + static const String name = 'SharedLinkRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [SharingPage] +class SharingRoute extends PageRouteInfo { + const SharingRoute({List? children}) + : super( + SharingRoute.name, + initialChildren: children, + ); + + static const String name = 'SharingRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [SplashScreenPage] +class SplashScreenRoute extends PageRouteInfo { + const SplashScreenRoute({List? children}) + : super( + SplashScreenRoute.name, + initialChildren: children, + ); + + static const String name = 'SplashScreenRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [TabControllerPage] +class TabControllerRoute extends PageRouteInfo { + const TabControllerRoute({List? children}) + : super( + TabControllerRoute.name, + initialChildren: children, + ); + + static const String name = 'TabControllerRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [TrashPage] +class TrashRoute extends PageRouteInfo { + const TrashRoute({List? children}) + : super( + TrashRoute.name, + initialChildren: children, + ); + + static const String name = 'TrashRoute'; + + static const PageInfo page = PageInfo(name); +} + /// generated route for /// [VideoViewerPage] class VideoViewerRoute extends PageRouteInfo { @@ -857,9 +1389,9 @@ class VideoViewerRoute extends PageRouteInfo { void Function()? onPlaying, void Function()? onPaused, Widget? placeholder, + List? children, }) : super( VideoViewerRoute.name, - path: '/video-viewer-page', args: VideoViewerRouteArgs( key: key, asset: asset, @@ -869,9 +1401,13 @@ class VideoViewerRoute extends PageRouteInfo { onPaused: onPaused, placeholder: placeholder, ), + initialChildren: children, ); static const String name = 'VideoViewerRoute'; + + static const PageInfo page = + PageInfo(name); } class VideoViewerRouteArgs { @@ -904,792 +1440,3 @@ class VideoViewerRouteArgs { return 'VideoViewerRouteArgs{key: $key, asset: $asset, isMotionVideo: $isMotionVideo, onVideoEnded: $onVideoEnded, onPlaying: $onPlaying, onPaused: $onPaused, placeholder: $placeholder}'; } } - -/// generated route for -/// [BackupControllerPage] -class BackupControllerRoute extends PageRouteInfo { - const BackupControllerRoute() - : super( - BackupControllerRoute.name, - path: '/backup-controller-page', - ); - - static const String name = 'BackupControllerRoute'; -} - -/// generated route for -/// [SearchResultPage] -class SearchResultRoute extends PageRouteInfo { - SearchResultRoute({ - Key? key, - required String searchTerm, - }) : super( - SearchResultRoute.name, - path: '/search-result-page', - args: SearchResultRouteArgs( - key: key, - searchTerm: searchTerm, - ), - ); - - static const String name = 'SearchResultRoute'; -} - -class SearchResultRouteArgs { - const SearchResultRouteArgs({ - this.key, - required this.searchTerm, - }); - - final Key? key; - - final String searchTerm; - - @override - String toString() { - return 'SearchResultRouteArgs{key: $key, searchTerm: $searchTerm}'; - } -} - -/// generated route for -/// [CuratedLocationPage] -class CuratedLocationRoute extends PageRouteInfo { - const CuratedLocationRoute() - : super( - CuratedLocationRoute.name, - path: '/curated-location-page', - ); - - static const String name = 'CuratedLocationRoute'; -} - -/// generated route for -/// [CreateAlbumPage] -class CreateAlbumRoute extends PageRouteInfo { - CreateAlbumRoute({ - Key? key, - required bool isSharedAlbum, - List? initialAssets, - }) : super( - CreateAlbumRoute.name, - path: '/create-album-page', - args: CreateAlbumRouteArgs( - key: key, - isSharedAlbum: isSharedAlbum, - initialAssets: initialAssets, - ), - ); - - static const String name = 'CreateAlbumRoute'; -} - -class CreateAlbumRouteArgs { - const CreateAlbumRouteArgs({ - this.key, - required this.isSharedAlbum, - this.initialAssets, - }); - - final Key? key; - - final bool isSharedAlbum; - - final List? initialAssets; - - @override - String toString() { - return 'CreateAlbumRouteArgs{key: $key, isSharedAlbum: $isSharedAlbum, initialAssets: $initialAssets}'; - } -} - -/// generated route for -/// [FavoritesPage] -class FavoritesRoute extends PageRouteInfo { - const FavoritesRoute() - : super( - FavoritesRoute.name, - path: '/favorites-page', - ); - - static const String name = 'FavoritesRoute'; -} - -/// generated route for -/// [AllVideosPage] -class AllVideosRoute extends PageRouteInfo { - const AllVideosRoute() - : super( - AllVideosRoute.name, - path: '/all-videos-page', - ); - - static const String name = 'AllVideosRoute'; -} - -/// generated route for -/// [AllMotionPhotosPage] -class AllMotionPhotosRoute extends PageRouteInfo { - const AllMotionPhotosRoute() - : super( - AllMotionPhotosRoute.name, - path: '/all-motion-photos-page', - ); - - static const String name = 'AllMotionPhotosRoute'; -} - -/// generated route for -/// [RecentlyAddedPage] -class RecentlyAddedRoute extends PageRouteInfo { - const RecentlyAddedRoute() - : super( - RecentlyAddedRoute.name, - path: '/recently-added-page', - ); - - static const String name = 'RecentlyAddedRoute'; -} - -/// generated route for -/// [AssetSelectionPage] -class AssetSelectionRoute extends PageRouteInfo { - AssetSelectionRoute({ - Key? key, - required Set existingAssets, - bool canDeselect = false, - required QueryBuilder? query, - }) : super( - AssetSelectionRoute.name, - path: '/asset-selection-page', - args: AssetSelectionRouteArgs( - key: key, - existingAssets: existingAssets, - canDeselect: canDeselect, - query: query, - ), - ); - - static const String name = 'AssetSelectionRoute'; -} - -class AssetSelectionRouteArgs { - const AssetSelectionRouteArgs({ - this.key, - required this.existingAssets, - this.canDeselect = false, - required this.query, - }); - - final Key? key; - - final Set existingAssets; - - final bool canDeselect; - - final QueryBuilder? query; - - @override - String toString() { - return 'AssetSelectionRouteArgs{key: $key, existingAssets: $existingAssets, canDeselect: $canDeselect, query: $query}'; - } -} - -/// generated route for -/// [SelectUserForSharingPage] -class SelectUserForSharingRoute - extends PageRouteInfo { - SelectUserForSharingRoute({ - Key? key, - required Set assets, - }) : super( - SelectUserForSharingRoute.name, - path: '/select-user-for-sharing-page', - args: SelectUserForSharingRouteArgs( - key: key, - assets: assets, - ), - ); - - static const String name = 'SelectUserForSharingRoute'; -} - -class SelectUserForSharingRouteArgs { - const SelectUserForSharingRouteArgs({ - this.key, - required this.assets, - }); - - final Key? key; - - final Set assets; - - @override - String toString() { - return 'SelectUserForSharingRouteArgs{key: $key, assets: $assets}'; - } -} - -/// generated route for -/// [AlbumViewerPage] -class AlbumViewerRoute extends PageRouteInfo { - AlbumViewerRoute({ - Key? key, - required int albumId, - }) : super( - AlbumViewerRoute.name, - path: '/album-viewer-page', - args: AlbumViewerRouteArgs( - key: key, - albumId: albumId, - ), - ); - - static const String name = 'AlbumViewerRoute'; -} - -class AlbumViewerRouteArgs { - const AlbumViewerRouteArgs({ - this.key, - required this.albumId, - }); - - final Key? key; - - final int albumId; - - @override - String toString() { - return 'AlbumViewerRouteArgs{key: $key, albumId: $albumId}'; - } -} - -/// generated route for -/// [SelectAdditionalUserForSharingPage] -class SelectAdditionalUserForSharingRoute - extends PageRouteInfo { - SelectAdditionalUserForSharingRoute({ - Key? key, - required Album album, - }) : super( - SelectAdditionalUserForSharingRoute.name, - path: '/select-additional-user-for-sharing-page', - args: SelectAdditionalUserForSharingRouteArgs( - key: key, - album: album, - ), - ); - - static const String name = 'SelectAdditionalUserForSharingRoute'; -} - -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 -/// [BackupAlbumSelectionPage] -class BackupAlbumSelectionRoute extends PageRouteInfo { - const BackupAlbumSelectionRoute() - : super( - BackupAlbumSelectionRoute.name, - path: '/backup-album-selection-page', - ); - - static const String name = 'BackupAlbumSelectionRoute'; -} - -/// generated route for -/// [AlbumPreviewPage] -class AlbumPreviewRoute extends PageRouteInfo { - AlbumPreviewRoute({ - Key? key, - required AssetPathEntity album, - }) : super( - AlbumPreviewRoute.name, - path: '/album-preview-page', - args: AlbumPreviewRouteArgs( - key: key, - album: album, - ), - ); - - static const String name = 'AlbumPreviewRoute'; -} - -class AlbumPreviewRouteArgs { - const AlbumPreviewRouteArgs({ - this.key, - required this.album, - }); - - final Key? key; - - final AssetPathEntity album; - - @override - String toString() { - return 'AlbumPreviewRouteArgs{key: $key, album: $album}'; - } -} - -/// generated route for -/// [FailedBackupStatusPage] -class FailedBackupStatusRoute extends PageRouteInfo { - const FailedBackupStatusRoute() - : super( - FailedBackupStatusRoute.name, - path: '/failed-backup-status-page', - ); - - static const String name = 'FailedBackupStatusRoute'; -} - -/// generated route for -/// [SettingsPage] -class SettingsRoute extends PageRouteInfo { - const SettingsRoute() - : super( - SettingsRoute.name, - path: '/settings-page', - ); - - static const String name = 'SettingsRoute'; -} - -/// generated route for -/// [AppLogPage] -class AppLogRoute extends PageRouteInfo { - const AppLogRoute() - : super( - AppLogRoute.name, - path: '/app-log-page', - ); - - static const String name = 'AppLogRoute'; -} - -/// generated route for -/// [AppLogDetailPage] -class AppLogDetailRoute extends PageRouteInfo { - AppLogDetailRoute({ - Key? key, - required LoggerMessage logMessage, - }) : super( - AppLogDetailRoute.name, - path: '/app-log-detail-page', - args: AppLogDetailRouteArgs( - key: key, - logMessage: logMessage, - ), - ); - - static const String name = 'AppLogDetailRoute'; -} - -class AppLogDetailRouteArgs { - const AppLogDetailRouteArgs({ - this.key, - required this.logMessage, - }); - - final Key? key; - - final LoggerMessage logMessage; - - @override - String toString() { - return 'AppLogDetailRouteArgs{key: $key, logMessage: $logMessage}'; - } -} - -/// generated route for -/// [ArchivePage] -class ArchiveRoute extends PageRouteInfo { - const ArchiveRoute() - : super( - ArchiveRoute.name, - path: '/archive-page', - ); - - static const String name = 'ArchiveRoute'; -} - -/// generated route for -/// [PartnerPage] -class PartnerRoute extends PageRouteInfo { - const PartnerRoute() - : super( - PartnerRoute.name, - path: '/partner-page', - ); - - static const String name = 'PartnerRoute'; -} - -/// generated route for -/// [PartnerDetailPage] -class PartnerDetailRoute extends PageRouteInfo { - PartnerDetailRoute({ - Key? key, - required User partner, - }) : super( - PartnerDetailRoute.name, - path: '/partner-detail-page', - args: PartnerDetailRouteArgs( - key: key, - partner: partner, - ), - ); - - static const String name = 'PartnerDetailRoute'; -} - -class PartnerDetailRouteArgs { - const PartnerDetailRouteArgs({ - this.key, - required this.partner, - }); - - final Key? key; - - final User partner; - - @override - String toString() { - return 'PartnerDetailRouteArgs{key: $key, partner: $partner}'; - } -} - -/// generated route for -/// [PersonResultPage] -class PersonResultRoute extends PageRouteInfo { - PersonResultRoute({ - Key? key, - required String personId, - required String personName, - }) : super( - PersonResultRoute.name, - path: '/person-result-page', - args: PersonResultRouteArgs( - key: key, - personId: personId, - personName: personName, - ), - ); - - static const String name = 'PersonResultRoute'; -} - -class PersonResultRouteArgs { - const PersonResultRouteArgs({ - this.key, - required this.personId, - required this.personName, - }); - - final Key? key; - - final String personId; - - final String personName; - - @override - String toString() { - return 'PersonResultRouteArgs{key: $key, personId: $personId, personName: $personName}'; - } -} - -/// generated route for -/// [AllPeoplePage] -class AllPeopleRoute extends PageRouteInfo { - const AllPeopleRoute() - : super( - AllPeopleRoute.name, - path: '/all-people-page', - ); - - static const String name = 'AllPeopleRoute'; -} - -/// generated route for -/// [MemoryPage] -class MemoryRoute extends PageRouteInfo { - MemoryRoute({ - required List memories, - required int memoryIndex, - Key? key, - }) : super( - MemoryRoute.name, - path: '/memory-page', - args: MemoryRouteArgs( - memories: memories, - memoryIndex: memoryIndex, - key: key, - ), - ); - - static const String name = 'MemoryRoute'; -} - -class MemoryRouteArgs { - const MemoryRouteArgs({ - required this.memories, - required this.memoryIndex, - this.key, - }); - - final List memories; - - final int memoryIndex; - - final Key? key; - - @override - String toString() { - return 'MemoryRouteArgs{memories: $memories, memoryIndex: $memoryIndex, key: $key}'; - } -} - -/// generated route for -/// [MapPage] -class MapRoute extends PageRouteInfo { - const MapRoute() - : super( - MapRoute.name, - path: '/map-page', - ); - - static const String name = 'MapRoute'; -} - -/// generated route for -/// [AlbumOptionsPage] -class AlbumOptionsRoute extends PageRouteInfo { - AlbumOptionsRoute({ - Key? key, - required Album album, - }) : super( - AlbumOptionsRoute.name, - path: '/album-options-page', - args: AlbumOptionsRouteArgs( - key: key, - album: album, - ), - ); - - static const String name = 'AlbumOptionsRoute'; -} - -class AlbumOptionsRouteArgs { - const AlbumOptionsRouteArgs({ - this.key, - required this.album, - }); - - final Key? key; - - final Album album; - - @override - String toString() { - return 'AlbumOptionsRouteArgs{key: $key, album: $album}'; - } -} - -/// generated route for -/// [TrashPage] -class TrashRoute extends PageRouteInfo { - const TrashRoute() - : super( - TrashRoute.name, - path: '/trash-page', - ); - - static const String name = 'TrashRoute'; -} - -/// generated route for -/// [SharedLinkPage] -class SharedLinkRoute extends PageRouteInfo { - const SharedLinkRoute() - : super( - SharedLinkRoute.name, - path: '/shared-link-page', - ); - - static const String name = 'SharedLinkRoute'; -} - -/// generated route for -/// [SharedLinkEditPage] -class SharedLinkEditRoute extends PageRouteInfo { - SharedLinkEditRoute({ - Key? key, - SharedLink? existingLink, - List? assetsList, - String? albumId, - }) : super( - SharedLinkEditRoute.name, - path: '/shared-link-edit-page', - args: SharedLinkEditRouteArgs( - key: key, - existingLink: existingLink, - assetsList: assetsList, - albumId: albumId, - ), - ); - - static const String name = 'SharedLinkEditRoute'; -} - -class SharedLinkEditRouteArgs { - const SharedLinkEditRouteArgs({ - this.key, - this.existingLink, - this.assetsList, - this.albumId, - }); - - final Key? key; - - final SharedLink? existingLink; - - final List? assetsList; - - final String? albumId; - - @override - String toString() { - return 'SharedLinkEditRouteArgs{key: $key, existingLink: $existingLink, assetsList: $assetsList, albumId: $albumId}'; - } -} - -/// generated route for -/// [ActivitiesPage] -class ActivitiesRoute extends PageRouteInfo { - const ActivitiesRoute() - : super( - ActivitiesRoute.name, - path: '/activities-page', - ); - - static const String name = 'ActivitiesRoute'; -} - -/// generated route for -/// [MapLocationPickerPage] -class MapLocationPickerRoute extends PageRouteInfo { - MapLocationPickerRoute({ - Key? key, - LatLng initialLatLng = const LatLng(0, 0), - }) : super( - MapLocationPickerRoute.name, - path: '/map-location-picker-page', - args: MapLocationPickerRouteArgs( - key: key, - initialLatLng: initialLatLng, - ), - ); - - static const String name = 'MapLocationPickerRoute'; -} - -class MapLocationPickerRouteArgs { - const MapLocationPickerRouteArgs({ - this.key, - this.initialLatLng = const LatLng(0, 0), - }); - - final Key? key; - - final LatLng initialLatLng; - - @override - String toString() { - return 'MapLocationPickerRouteArgs{key: $key, initialLatLng: $initialLatLng}'; - } -} - -/// generated route for -/// [BackupOptionsPage] -class BackupOptionsRoute extends PageRouteInfo { - const BackupOptionsRoute() - : super( - BackupOptionsRoute.name, - path: '/backup-options-page', - ); - - static const String name = 'BackupOptionsRoute'; -} - -/// generated route for -/// [HomePage] -class HomeRoute extends PageRouteInfo { - const HomeRoute() - : super( - HomeRoute.name, - path: 'home-page', - ); - - static const String name = 'HomeRoute'; -} - -/// generated route for -/// [SearchPage] -class SearchRoute extends PageRouteInfo { - SearchRoute({Key? key}) - : super( - SearchRoute.name, - path: 'search-page', - args: SearchRouteArgs(key: key), - ); - - static const String name = 'SearchRoute'; -} - -class SearchRouteArgs { - const SearchRouteArgs({this.key}); - - final Key? key; - - @override - String toString() { - return 'SearchRouteArgs{key: $key}'; - } -} - -/// generated route for -/// [SharingPage] -class SharingRoute extends PageRouteInfo { - const SharingRoute() - : super( - SharingRoute.name, - path: 'sharing-page', - ); - - static const String name = 'SharingRoute'; -} - -/// generated route for -/// [LibraryPage] -class LibraryRoute extends PageRouteInfo { - const LibraryRoute() - : super( - LibraryRoute.name, - path: 'library-page', - ); - - static const String name = 'LibraryRoute'; -} diff --git a/mobile/lib/shared/views/app_log_detail_page.dart b/mobile/lib/shared/views/app_log_detail_page.dart index 8b737fb5cc..126f46c8ff 100644 --- a/mobile/lib/shared/views/app_log_detail_page.dart +++ b/mobile/lib/shared/views/app_log_detail_page.dart @@ -1,9 +1,11 @@ +import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:immich_mobile/extensions/build_context_extensions.dart'; import 'package:immich_mobile/shared/models/logger_message.model.dart'; import 'package:flutter/services.dart'; +@RoutePage() class AppLogDetailPage extends HookConsumerWidget { const AppLogDetailPage({super.key, required this.logMessage}); diff --git a/mobile/lib/shared/views/app_log_page.dart b/mobile/lib/shared/views/app_log_page.dart index a5b63d0d28..514e93d74c 100644 --- a/mobile/lib/shared/views/app_log_page.dart +++ b/mobile/lib/shared/views/app_log_page.dart @@ -8,6 +8,7 @@ import 'package:immich_mobile/shared/models/logger_message.model.dart'; import 'package:immich_mobile/shared/services/immich_logger.service.dart'; import 'package:intl/intl.dart'; +@RoutePage() class AppLogPage extends HookConsumerWidget { const AppLogPage({ Key? key, diff --git a/mobile/lib/shared/views/splash_screen.dart b/mobile/lib/shared/views/splash_screen.dart index e51debdbac..510c88a7bc 100644 --- a/mobile/lib/shared/views/splash_screen.dart +++ b/mobile/lib/shared/views/splash_screen.dart @@ -11,6 +11,7 @@ import 'package:immich_mobile/shared/providers/api.provider.dart'; import 'package:logging/logging.dart'; import 'package:openapi/api.dart'; +@RoutePage() class SplashScreenPage extends HookConsumerWidget { const SplashScreenPage({Key? key}) : super(key: key); diff --git a/mobile/lib/shared/views/tab_controller_page.dart b/mobile/lib/shared/views/tab_controller_page.dart index 2440f5728b..d1a92c15a3 100644 --- a/mobile/lib/shared/views/tab_controller_page.dart +++ b/mobile/lib/shared/views/tab_controller_page.dart @@ -11,6 +11,7 @@ import 'package:immich_mobile/routing/router.dart'; import 'package:immich_mobile/shared/providers/asset.provider.dart'; import 'package:immich_mobile/shared/providers/tab.provider.dart'; +@RoutePage() class TabControllerPage extends HookConsumerWidget { const TabControllerPage({Key? key}) : super(key: key); @@ -167,6 +168,15 @@ class TabControllerPage extends HookConsumerWidget { ); } + Future returnBackToHome(TabsRouter tabsRouter) async { + bool atHomeTab = tabsRouter.activeIndex == 0; + if (!atHomeTab) { + tabsRouter.setActiveIndex(0); + } + + return atHomeTab; + } + final multiselectEnabled = ref.watch(multiselectProvider); return AutoTabsRouter( routes: [ @@ -175,17 +185,15 @@ class TabControllerPage extends HookConsumerWidget { const SharingRoute(), const LibraryRoute(), ], - builder: (context, child, animation) { + duration: const Duration(milliseconds: 600), + transitionBuilder: (context, child, animation) => FadeTransition( + opacity: animation, + child: child, + ), + builder: (context, child) { final tabsRouter = AutoTabsRouter.of(context); return WillPopScope( - onWillPop: () async { - bool atHomeTab = tabsRouter.activeIndex == 0; - if (!atHomeTab) { - tabsRouter.setActiveIndex(0); - } - - return atHomeTab; - }, + onWillPop: () => returnBackToHome(tabsRouter), child: LayoutBuilder( builder: (context, constraints) { const medium = 600; @@ -194,22 +202,14 @@ class TabControllerPage extends HookConsumerWidget { if (constraints.maxWidth < medium) { // Normal phone width bottom = bottomNavigationBar(tabsRouter); - body = FadeTransition( - opacity: animation, - child: child, - ); + body = child; } else { // Medium tablet width bottom = null; body = Row( children: [ navigationRail(tabsRouter), - Expanded( - child: FadeTransition( - opacity: animation, - child: child, - ), - ), + Expanded(child: child), ], ); } diff --git a/mobile/pubspec.lock b/mobile/pubspec.lock index 8598a76dac..14b9c2e786 100644 --- a/mobile/pubspec.lock +++ b/mobile/pubspec.lock @@ -61,18 +61,18 @@ packages: dependency: "direct main" description: name: auto_route - sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" + sha256: "82f8df1d177416bc6b7a449127d0270ff1f0f633a91f2ceb7a85d4f07c3affa1" url: "https://pub.dev" source: hosted - version: "5.0.4" + version: "7.8.4" auto_route_generator: dependency: "direct dev" description: name: auto_route_generator - sha256: de5bfbc02ae4eebb339dd90d325749ae7536e903f6513ef72b88954072d72b0e + sha256: "11067a3bcd643812518fe26c0c9ec073990286cabfd9d74b6da9ef9b913c4d22" url: "https://pub.dev" source: hosted - version: "5.0.3" + version: "7.3.2" boolean_selector: dependency: transitive description: @@ -1717,4 +1717,4 @@ packages: version: "3.1.2" sdks: dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=3.10.0" + flutter: ">=3.13.0" diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml index 3759e31852..42bb38a679 100644 --- a/mobile/pubspec.yaml +++ b/mobile/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: cached_network_image: ^3.2.2 flutter_cache_manager: ^3.3.0 intl: ^0.18.0 - auto_route: ^5.0.1 + auto_route: ^7.0.0 fluttertoast: ^8.2.2 video_player: ^2.2.18 chewie: ^1.4.0 @@ -76,7 +76,7 @@ dev_dependencies: sdk: flutter flutter_lints: ^2.0.1 build_runner: ^2.2.1 - auto_route_generator: ^5.0.2 + auto_route_generator: ^7.0.0 flutter_launcher_icons: ^0.13.1 flutter_native_splash: ^2.2.16 isar_generator: *isar_version