1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-23 02:06:15 +02:00

fix(mobile): Prevents duplicate taps navigating to the same route twice (#1855)

This commit is contained in:
martyfuhry 2023-02-24 11:51:35 -05:00 committed by GitHub
parent 9323cc76d9
commit 4ed96cf1bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 553 additions and 224 deletions

View File

@ -141,8 +141,7 @@ class ImmichAppState extends ConsumerState<ImmichApp>
ref.watch(releaseInfoProvider.notifier).checkGithubReleaseInfo(); ref.watch(releaseInfoProvider.notifier).checkGithubReleaseInfo();
ref ref.watch(notificationPermissionProvider.notifier)
.watch(notificationPermissionProvider.notifier)
.getNotificationPermission(); .getNotificationPermission();
ref.read(iOSBackgroundSettingsProvider.notifier).refresh(); ref.read(iOSBackgroundSettingsProvider.notifier).refresh();

View File

@ -0,0 +1,17 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/foundation.dart';
/// Guards against duplicate navigation to this route
class DuplicateGuard extends AutoRouteGuard {
DuplicateGuard();
@override
void onNavigation(NavigationResolver resolver, StackRouter router) async {
// Duplicate navigation
if (resolver.route.name == router.current.name) {
debugPrint('DuplicateGuard: Preventing duplicate route navigation for ${resolver.route.name}');
resolver.next(false);
} else {
resolver.next(true);
}
}
}

View File

@ -23,6 +23,7 @@ import 'package:immich_mobile/modules/search/views/search_page.dart';
import 'package:immich_mobile/modules/search/views/search_result_page.dart'; import 'package:immich_mobile/modules/search/views/search_result_page.dart';
import 'package:immich_mobile/modules/settings/views/settings_page.dart'; import 'package:immich_mobile/modules/settings/views/settings_page.dart';
import 'package:immich_mobile/routing/auth_guard.dart'; import 'package:immich_mobile/routing/auth_guard.dart';
import 'package:immich_mobile/routing/duplicate_guard.dart';
import 'package:immich_mobile/shared/models/asset.dart'; import 'package:immich_mobile/shared/models/asset.dart';
import 'package:immich_mobile/shared/models/album.dart'; import 'package:immich_mobile/shared/models/album.dart';
import 'package:immich_mobile/shared/providers/api.provider.dart'; import 'package:immich_mobile/shared/providers/api.provider.dart';
@ -38,49 +39,58 @@ part 'router.gr.dart';
replaceInRouteName: 'Page,Route', replaceInRouteName: 'Page,Route',
routes: <AutoRoute>[ routes: <AutoRoute>[
AutoRoute(page: SplashScreenPage, initial: true), AutoRoute(page: SplashScreenPage, initial: true),
AutoRoute(page: LoginPage), AutoRoute(page: LoginPage,
guards: [
DuplicateGuard,
],
),
AutoRoute(page: ChangePasswordPage), AutoRoute(page: ChangePasswordPage),
CustomRoute( CustomRoute(
page: TabControllerPage, page: TabControllerPage,
guards: [AuthGuard], guards: [AuthGuard, DuplicateGuard],
children: [ children: [
AutoRoute(page: HomePage, guards: [AuthGuard]), AutoRoute(page: HomePage, guards: [AuthGuard, DuplicateGuard]),
AutoRoute(page: SearchPage, guards: [AuthGuard]), AutoRoute(page: SearchPage, guards: [AuthGuard, DuplicateGuard]),
AutoRoute(page: SharingPage, guards: [AuthGuard]), AutoRoute(page: SharingPage, guards: [AuthGuard, DuplicateGuard]),
AutoRoute(page: LibraryPage, guards: [AuthGuard]) AutoRoute(page: LibraryPage, guards: [AuthGuard, DuplicateGuard])
], ],
transitionsBuilder: TransitionsBuilders.fadeIn, transitionsBuilder: TransitionsBuilders.fadeIn,
), ),
AutoRoute(page: GalleryViewerPage, guards: [AuthGuard]), AutoRoute(page: GalleryViewerPage, guards: [AuthGuard, DuplicateGuard]),
AutoRoute(page: VideoViewerPage, guards: [AuthGuard]), AutoRoute(page: VideoViewerPage, guards: [AuthGuard, DuplicateGuard]),
AutoRoute(page: BackupControllerPage, guards: [AuthGuard]), AutoRoute(page: BackupControllerPage, guards: [AuthGuard, DuplicateGuard]),
AutoRoute(page: SearchResultPage, guards: [AuthGuard]), AutoRoute(page: SearchResultPage, guards: [AuthGuard, DuplicateGuard]),
AutoRoute(page: CreateAlbumPage, guards: [AuthGuard]), AutoRoute(page: CreateAlbumPage, guards: [AuthGuard, DuplicateGuard]),
AutoRoute(page: FavoritesPage, guards: [AuthGuard]), AutoRoute(page: FavoritesPage, guards: [AuthGuard, DuplicateGuard]),
CustomRoute<AssetSelectionPageResult?>( CustomRoute<AssetSelectionPageResult?>(
page: AssetSelectionPage, page: AssetSelectionPage,
guards: [AuthGuard], guards: [AuthGuard, DuplicateGuard],
transitionsBuilder: TransitionsBuilders.slideBottom, transitionsBuilder: TransitionsBuilders.slideBottom,
), ),
CustomRoute<List<String>>( CustomRoute<List<String>>(
page: SelectUserForSharingPage, page: SelectUserForSharingPage,
guards: [AuthGuard], guards: [AuthGuard, DuplicateGuard],
transitionsBuilder: TransitionsBuilders.slideBottom, transitionsBuilder: TransitionsBuilders.slideBottom,
), ),
AutoRoute(page: AlbumViewerPage, guards: [AuthGuard]), AutoRoute(page: AlbumViewerPage, guards: [AuthGuard, DuplicateGuard]),
CustomRoute<List<String>?>( CustomRoute<List<String>?>(
page: SelectAdditionalUserForSharingPage, page: SelectAdditionalUserForSharingPage,
guards: [AuthGuard], guards: [AuthGuard, DuplicateGuard],
transitionsBuilder: TransitionsBuilders.slideBottom, transitionsBuilder: TransitionsBuilders.slideBottom,
), ),
AutoRoute(page: BackupAlbumSelectionPage, guards: [AuthGuard]), AutoRoute(page: BackupAlbumSelectionPage, guards: [AuthGuard, DuplicateGuard]),
AutoRoute(page: AlbumPreviewPage, guards: [AuthGuard]), AutoRoute(page: AlbumPreviewPage, guards: [AuthGuard, DuplicateGuard]),
CustomRoute( CustomRoute(
page: FailedBackupStatusPage, page: FailedBackupStatusPage,
guards: [AuthGuard], guards: [AuthGuard, DuplicateGuard],
transitionsBuilder: TransitionsBuilders.slideBottom, transitionsBuilder: TransitionsBuilders.slideBottom,
), ),
AutoRoute(page: SettingsPage, guards: [AuthGuard]), AutoRoute(page: SettingsPage,
guards: [
AuthGuard,
DuplicateGuard,
],
),
CustomRoute( CustomRoute(
page: AppLogPage, page: AppLogPage,
transitionsBuilder: TransitionsBuilders.slideBottom, transitionsBuilder: TransitionsBuilders.slideBottom,
@ -91,7 +101,11 @@ class AppRouter extends _$AppRouter {
// ignore: unused_field // ignore: unused_field
final ApiService _apiService; final ApiService _apiService;
AppRouter(this._apiService) : super(authGuard: AuthGuard(_apiService)); AppRouter(this._apiService)
: super(
authGuard: AuthGuard(_apiService),
duplicateGuard: DuplicateGuard(),
);
} }
final appRouterProvider = final appRouterProvider =

View File

@ -13,9 +13,13 @@
part of 'router.dart'; part of 'router.dart';
class _$AppRouter extends RootStackRouter { class _$AppRouter extends RootStackRouter {
_$AppRouter( _$AppRouter({
{GlobalKey<NavigatorState>? navigatorKey, required this.authGuard}) GlobalKey<NavigatorState>? navigatorKey,
: super(navigatorKey); required this.duplicateGuard,
required this.authGuard,
}) : super(navigatorKey);
final DuplicateGuard duplicateGuard;
final AuthGuard authGuard; final AuthGuard authGuard;
@ -23,15 +27,21 @@ class _$AppRouter extends RootStackRouter {
final Map<String, PageFactory> pagesMap = { final Map<String, PageFactory> pagesMap = {
SplashScreenRoute.name: (routeData) { SplashScreenRoute.name: (routeData) {
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: const SplashScreenPage()); routeData: routeData,
child: const SplashScreenPage(),
);
}, },
LoginRoute.name: (routeData) { LoginRoute.name: (routeData) {
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: const LoginPage()); routeData: routeData,
child: const LoginPage(),
);
}, },
ChangePasswordRoute.name: (routeData) { ChangePasswordRoute.name: (routeData) {
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: const ChangePasswordPage()); routeData: routeData,
child: const ChangePasswordPage(),
);
}, },
TabControllerRoute.name: (routeData) { TabControllerRoute.name: (routeData) {
return CustomPage<dynamic>( return CustomPage<dynamic>(
@ -39,14 +49,19 @@ class _$AppRouter extends RootStackRouter {
child: const TabControllerPage(), child: const TabControllerPage(),
transitionsBuilder: TransitionsBuilders.fadeIn, transitionsBuilder: TransitionsBuilders.fadeIn,
opaque: true, opaque: true,
barrierDismissible: false); barrierDismissible: false,
);
}, },
GalleryViewerRoute.name: (routeData) { GalleryViewerRoute.name: (routeData) {
final args = routeData.argsAs<GalleryViewerRouteArgs>(); final args = routeData.argsAs<GalleryViewerRouteArgs>();
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, routeData: routeData,
child: GalleryViewerPage( child: GalleryViewerPage(
key: args.key, assetList: args.assetList, asset: args.asset)); key: args.key,
assetList: args.assetList,
asset: args.asset,
),
);
}, },
VideoViewerRoute.name: (routeData) { VideoViewerRoute.name: (routeData) {
final args = routeData.argsAs<VideoViewerRouteArgs>(); final args = routeData.argsAs<VideoViewerRouteArgs>();
@ -56,17 +71,27 @@ class _$AppRouter extends RootStackRouter {
key: args.key, key: args.key,
asset: args.asset, asset: args.asset,
isMotionVideo: args.isMotionVideo, isMotionVideo: args.isMotionVideo,
onVideoEnded: args.onVideoEnded)); onVideoEnded: args.onVideoEnded,
onPlaying: args.onPlaying,
onPaused: args.onPaused,
),
);
}, },
BackupControllerRoute.name: (routeData) { BackupControllerRoute.name: (routeData) {
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: const BackupControllerPage()); routeData: routeData,
child: const BackupControllerPage(),
);
}, },
SearchResultRoute.name: (routeData) { SearchResultRoute.name: (routeData) {
final args = routeData.argsAs<SearchResultRouteArgs>(); final args = routeData.argsAs<SearchResultRouteArgs>();
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, routeData: routeData,
child: SearchResultPage(key: args.key, searchTerm: args.searchTerm)); child: SearchResultPage(
key: args.key,
searchTerm: args.searchTerm,
),
);
}, },
CreateAlbumRoute.name: (routeData) { CreateAlbumRoute.name: (routeData) {
final args = routeData.argsAs<CreateAlbumRouteArgs>(); final args = routeData.argsAs<CreateAlbumRouteArgs>();
@ -75,11 +100,15 @@ class _$AppRouter extends RootStackRouter {
child: CreateAlbumPage( child: CreateAlbumPage(
key: args.key, key: args.key,
isSharedAlbum: args.isSharedAlbum, isSharedAlbum: args.isSharedAlbum,
initialAssets: args.initialAssets)); initialAssets: args.initialAssets,
),
);
}, },
FavoritesRoute.name: (routeData) { FavoritesRoute.name: (routeData) {
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: const FavoritesPage()); routeData: routeData,
child: const FavoritesPage(),
);
}, },
AssetSelectionRoute.name: (routeData) { AssetSelectionRoute.name: (routeData) {
return CustomPage<AssetSelectionPageResult?>( return CustomPage<AssetSelectionPageResult?>(
@ -87,7 +116,8 @@ class _$AppRouter extends RootStackRouter {
child: const AssetSelectionPage(), child: const AssetSelectionPage(),
transitionsBuilder: TransitionsBuilders.slideBottom, transitionsBuilder: TransitionsBuilders.slideBottom,
opaque: true, opaque: true,
barrierDismissible: false); barrierDismissible: false,
);
}, },
SelectUserForSharingRoute.name: (routeData) { SelectUserForSharingRoute.name: (routeData) {
return CustomPage<List<String>>( return CustomPage<List<String>>(
@ -95,33 +125,47 @@ class _$AppRouter extends RootStackRouter {
child: const SelectUserForSharingPage(), child: const SelectUserForSharingPage(),
transitionsBuilder: TransitionsBuilders.slideBottom, transitionsBuilder: TransitionsBuilders.slideBottom,
opaque: true, opaque: true,
barrierDismissible: false); barrierDismissible: false,
);
}, },
AlbumViewerRoute.name: (routeData) { AlbumViewerRoute.name: (routeData) {
final args = routeData.argsAs<AlbumViewerRouteArgs>(); final args = routeData.argsAs<AlbumViewerRouteArgs>();
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, routeData: routeData,
child: AlbumViewerPage(key: args.key, albumId: args.albumId)); child: AlbumViewerPage(
key: args.key,
albumId: args.albumId,
),
);
}, },
SelectAdditionalUserForSharingRoute.name: (routeData) { SelectAdditionalUserForSharingRoute.name: (routeData) {
final args = routeData.argsAs<SelectAdditionalUserForSharingRouteArgs>(); final args = routeData.argsAs<SelectAdditionalUserForSharingRouteArgs>();
return CustomPage<List<String>?>( return CustomPage<List<String>?>(
routeData: routeData, routeData: routeData,
child: SelectAdditionalUserForSharingPage( child: SelectAdditionalUserForSharingPage(
key: args.key, album: args.album), key: args.key,
album: args.album,
),
transitionsBuilder: TransitionsBuilders.slideBottom, transitionsBuilder: TransitionsBuilders.slideBottom,
opaque: true, opaque: true,
barrierDismissible: false); barrierDismissible: false,
);
}, },
BackupAlbumSelectionRoute.name: (routeData) { BackupAlbumSelectionRoute.name: (routeData) {
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: const BackupAlbumSelectionPage()); routeData: routeData,
child: const BackupAlbumSelectionPage(),
);
}, },
AlbumPreviewRoute.name: (routeData) { AlbumPreviewRoute.name: (routeData) {
final args = routeData.argsAs<AlbumPreviewRouteArgs>(); final args = routeData.argsAs<AlbumPreviewRouteArgs>();
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, routeData: routeData,
child: AlbumPreviewPage(key: args.key, album: args.album)); child: AlbumPreviewPage(
key: args.key,
album: args.album,
),
);
}, },
FailedBackupStatusRoute.name: (routeData) { FailedBackupStatusRoute.name: (routeData) {
return CustomPage<dynamic>( return CustomPage<dynamic>(
@ -129,11 +173,14 @@ class _$AppRouter extends RootStackRouter {
child: const FailedBackupStatusPage(), child: const FailedBackupStatusPage(),
transitionsBuilder: TransitionsBuilders.slideBottom, transitionsBuilder: TransitionsBuilders.slideBottom,
opaque: true, opaque: true,
barrierDismissible: false); barrierDismissible: false,
);
}, },
SettingsRoute.name: (routeData) { SettingsRoute.name: (routeData) {
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: const SettingsPage()); routeData: routeData,
child: const SettingsPage(),
);
}, },
AppLogRoute.name: (routeData) { AppLogRoute.name: (routeData) {
return CustomPage<dynamic>( return CustomPage<dynamic>(
@ -141,93 +188,225 @@ class _$AppRouter extends RootStackRouter {
child: const AppLogPage(), child: const AppLogPage(),
transitionsBuilder: TransitionsBuilders.slideBottom, transitionsBuilder: TransitionsBuilders.slideBottom,
opaque: true, opaque: true,
barrierDismissible: false); barrierDismissible: false,
);
}, },
HomeRoute.name: (routeData) { HomeRoute.name: (routeData) {
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: const HomePage()); routeData: routeData,
child: const HomePage(),
);
}, },
SearchRoute.name: (routeData) { SearchRoute.name: (routeData) {
final args = routeData.argsAs<SearchRouteArgs>( final args = routeData.argsAs<SearchRouteArgs>(
orElse: () => const SearchRouteArgs()); orElse: () => const SearchRouteArgs());
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: SearchPage(key: args.key)); routeData: routeData,
child: SearchPage(key: args.key),
);
}, },
SharingRoute.name: (routeData) { SharingRoute.name: (routeData) {
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: const SharingPage()); routeData: routeData,
child: const SharingPage(),
);
}, },
LibraryRoute.name: (routeData) { LibraryRoute.name: (routeData) {
return MaterialPageX<dynamic>( return MaterialPageX<dynamic>(
routeData: routeData, child: const LibraryPage()); routeData: routeData,
} child: const LibraryPage(),
);
},
}; };
@override @override
List<RouteConfig> get routes => [ List<RouteConfig> get routes => [
RouteConfig(SplashScreenRoute.name, path: '/'), RouteConfig(
RouteConfig(LoginRoute.name, path: '/login-page'), SplashScreenRoute.name,
RouteConfig(ChangePasswordRoute.name, path: '/change-password-page'), path: '/',
RouteConfig(TabControllerRoute.name, ),
RouteConfig(
LoginRoute.name,
path: '/login-page',
guards: [duplicateGuard],
),
RouteConfig(
ChangePasswordRoute.name,
path: '/change-password-page',
),
RouteConfig(
TabControllerRoute.name,
path: '/tab-controller-page', path: '/tab-controller-page',
guards: [ guards: [
authGuard authGuard,
duplicateGuard,
], ],
children: [ children: [
RouteConfig(HomeRoute.name, RouteConfig(
HomeRoute.name,
path: 'home-page', path: 'home-page',
parent: TabControllerRoute.name, parent: TabControllerRoute.name,
guards: [authGuard]), guards: [
RouteConfig(SearchRoute.name, authGuard,
duplicateGuard,
],
),
RouteConfig(
SearchRoute.name,
path: 'search-page', path: 'search-page',
parent: TabControllerRoute.name, parent: TabControllerRoute.name,
guards: [authGuard]), guards: [
RouteConfig(SharingRoute.name, authGuard,
duplicateGuard,
],
),
RouteConfig(
SharingRoute.name,
path: 'sharing-page', path: 'sharing-page',
parent: TabControllerRoute.name, parent: TabControllerRoute.name,
guards: [authGuard]), guards: [
RouteConfig(LibraryRoute.name, authGuard,
duplicateGuard,
],
),
RouteConfig(
LibraryRoute.name,
path: 'library-page', path: 'library-page',
parent: TabControllerRoute.name, parent: TabControllerRoute.name,
guards: [authGuard]) guards: [
]), authGuard,
RouteConfig(GalleryViewerRoute.name, duplicateGuard,
path: '/gallery-viewer-page', guards: [authGuard]), ],
RouteConfig(VideoViewerRoute.name, ),
path: '/video-viewer-page', guards: [authGuard]), ],
RouteConfig(BackupControllerRoute.name, ),
path: '/backup-controller-page', guards: [authGuard]), RouteConfig(
RouteConfig(SearchResultRoute.name, GalleryViewerRoute.name,
path: '/search-result-page', guards: [authGuard]), path: '/gallery-viewer-page',
RouteConfig(CreateAlbumRoute.name, guards: [
path: '/create-album-page', guards: [authGuard]), authGuard,
RouteConfig(FavoritesRoute.name, duplicateGuard,
path: '/favorites-page', guards: [authGuard]), ],
RouteConfig(AssetSelectionRoute.name, ),
path: '/asset-selection-page', guards: [authGuard]), RouteConfig(
RouteConfig(SelectUserForSharingRoute.name, VideoViewerRoute.name,
path: '/select-user-for-sharing-page', guards: [authGuard]), path: '/video-viewer-page',
RouteConfig(AlbumViewerRoute.name, guards: [
path: '/album-viewer-page', guards: [authGuard]), authGuard,
RouteConfig(SelectAdditionalUserForSharingRoute.name, duplicateGuard,
],
),
RouteConfig(
BackupControllerRoute.name,
path: '/backup-controller-page',
guards: [
authGuard,
duplicateGuard,
],
),
RouteConfig(
SearchResultRoute.name,
path: '/search-result-page',
guards: [
authGuard,
duplicateGuard,
],
),
RouteConfig(
CreateAlbumRoute.name,
path: '/create-album-page',
guards: [
authGuard,
duplicateGuard,
],
),
RouteConfig(
FavoritesRoute.name,
path: '/favorites-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', path: '/select-additional-user-for-sharing-page',
guards: [authGuard]), guards: [
RouteConfig(BackupAlbumSelectionRoute.name, authGuard,
path: '/backup-album-selection-page', guards: [authGuard]), duplicateGuard,
RouteConfig(AlbumPreviewRoute.name, ],
path: '/album-preview-page', guards: [authGuard]), ),
RouteConfig(FailedBackupStatusRoute.name, RouteConfig(
path: '/failed-backup-status-page', guards: [authGuard]), BackupAlbumSelectionRoute.name,
RouteConfig(SettingsRoute.name, path: '/backup-album-selection-page',
path: '/settings-page', guards: [authGuard]), guards: [
RouteConfig(AppLogRoute.name, path: '/app-log-page') authGuard,
duplicateGuard,
],
),
RouteConfig(
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: [
authGuard,
duplicateGuard,
],
),
RouteConfig(
AppLogRoute.name,
path: '/app-log-page',
),
]; ];
} }
/// generated route for /// generated route for
/// [SplashScreenPage] /// [SplashScreenPage]
class SplashScreenRoute extends PageRouteInfo<void> { class SplashScreenRoute extends PageRouteInfo<void> {
const SplashScreenRoute() : super(SplashScreenRoute.name, path: '/'); const SplashScreenRoute()
: super(
SplashScreenRoute.name,
path: '/',
);
static const String name = 'SplashScreenRoute'; static const String name = 'SplashScreenRoute';
} }
@ -235,7 +414,11 @@ class SplashScreenRoute extends PageRouteInfo<void> {
/// generated route for /// generated route for
/// [LoginPage] /// [LoginPage]
class LoginRoute extends PageRouteInfo<void> { class LoginRoute extends PageRouteInfo<void> {
const LoginRoute() : super(LoginRoute.name, path: '/login-page'); const LoginRoute()
: super(
LoginRoute.name,
path: '/login-page',
);
static const String name = 'LoginRoute'; static const String name = 'LoginRoute';
} }
@ -244,7 +427,10 @@ class LoginRoute extends PageRouteInfo<void> {
/// [ChangePasswordPage] /// [ChangePasswordPage]
class ChangePasswordRoute extends PageRouteInfo<void> { class ChangePasswordRoute extends PageRouteInfo<void> {
const ChangePasswordRoute() const ChangePasswordRoute()
: super(ChangePasswordRoute.name, path: '/change-password-page'); : super(
ChangePasswordRoute.name,
path: '/change-password-page',
);
static const String name = 'ChangePasswordRoute'; static const String name = 'ChangePasswordRoute';
} }
@ -253,8 +439,11 @@ class ChangePasswordRoute extends PageRouteInfo<void> {
/// [TabControllerPage] /// [TabControllerPage]
class TabControllerRoute extends PageRouteInfo<void> { class TabControllerRoute extends PageRouteInfo<void> {
const TabControllerRoute({List<PageRouteInfo>? children}) const TabControllerRoute({List<PageRouteInfo>? children})
: super(TabControllerRoute.name, : super(
path: '/tab-controller-page', initialChildren: children); TabControllerRoute.name,
path: '/tab-controller-page',
initialChildren: children,
);
static const String name = 'TabControllerRoute'; static const String name = 'TabControllerRoute';
} }
@ -262,19 +451,29 @@ class TabControllerRoute extends PageRouteInfo<void> {
/// generated route for /// generated route for
/// [GalleryViewerPage] /// [GalleryViewerPage]
class GalleryViewerRoute extends PageRouteInfo<GalleryViewerRouteArgs> { class GalleryViewerRoute extends PageRouteInfo<GalleryViewerRouteArgs> {
GalleryViewerRoute( GalleryViewerRoute({
{Key? key, required List<Asset> assetList, required Asset asset}) Key? key,
: super(GalleryViewerRoute.name, required List<Asset> assetList,
required Asset asset,
}) : super(
GalleryViewerRoute.name,
path: '/gallery-viewer-page', path: '/gallery-viewer-page',
args: GalleryViewerRouteArgs( args: GalleryViewerRouteArgs(
key: key, assetList: assetList, asset: asset)); key: key,
assetList: assetList,
asset: asset,
),
);
static const String name = 'GalleryViewerRoute'; static const String name = 'GalleryViewerRoute';
} }
class GalleryViewerRouteArgs { class GalleryViewerRouteArgs {
const GalleryViewerRouteArgs( const GalleryViewerRouteArgs({
{this.key, required this.assetList, required this.asset}); this.key,
required this.assetList,
required this.asset,
});
final Key? key; final Key? key;
@ -291,28 +490,38 @@ class GalleryViewerRouteArgs {
/// generated route for /// generated route for
/// [VideoViewerPage] /// [VideoViewerPage]
class VideoViewerRoute extends PageRouteInfo<VideoViewerRouteArgs> { class VideoViewerRoute extends PageRouteInfo<VideoViewerRouteArgs> {
VideoViewerRoute( VideoViewerRoute({
{Key? key, Key? key,
required Asset asset, required Asset asset,
required bool isMotionVideo, required bool isMotionVideo,
required void Function() onVideoEnded}) required void Function() onVideoEnded,
: super(VideoViewerRoute.name, void Function()? onPlaying,
void Function()? onPaused,
}) : super(
VideoViewerRoute.name,
path: '/video-viewer-page', path: '/video-viewer-page',
args: VideoViewerRouteArgs( args: VideoViewerRouteArgs(
key: key, key: key,
asset: asset, asset: asset,
isMotionVideo: isMotionVideo, isMotionVideo: isMotionVideo,
onVideoEnded: onVideoEnded)); onVideoEnded: onVideoEnded,
onPlaying: onPlaying,
onPaused: onPaused,
),
);
static const String name = 'VideoViewerRoute'; static const String name = 'VideoViewerRoute';
} }
class VideoViewerRouteArgs { class VideoViewerRouteArgs {
const VideoViewerRouteArgs( const VideoViewerRouteArgs({
{this.key, this.key,
required this.asset, required this.asset,
required this.isMotionVideo, required this.isMotionVideo,
required this.onVideoEnded}); required this.onVideoEnded,
this.onPlaying,
this.onPaused,
});
final Key? key; final Key? key;
@ -322,9 +531,13 @@ class VideoViewerRouteArgs {
final void Function() onVideoEnded; final void Function() onVideoEnded;
final void Function()? onPlaying;
final void Function()? onPaused;
@override @override
String toString() { String toString() {
return 'VideoViewerRouteArgs{key: $key, asset: $asset, isMotionVideo: $isMotionVideo, onVideoEnded: $onVideoEnded}'; return 'VideoViewerRouteArgs{key: $key, asset: $asset, isMotionVideo: $isMotionVideo, onVideoEnded: $onVideoEnded, onPlaying: $onPlaying, onPaused: $onPaused}';
} }
} }
@ -332,7 +545,10 @@ class VideoViewerRouteArgs {
/// [BackupControllerPage] /// [BackupControllerPage]
class BackupControllerRoute extends PageRouteInfo<void> { class BackupControllerRoute extends PageRouteInfo<void> {
const BackupControllerRoute() const BackupControllerRoute()
: super(BackupControllerRoute.name, path: '/backup-controller-page'); : super(
BackupControllerRoute.name,
path: '/backup-controller-page',
);
static const String name = 'BackupControllerRoute'; static const String name = 'BackupControllerRoute';
} }
@ -340,16 +556,26 @@ class BackupControllerRoute extends PageRouteInfo<void> {
/// generated route for /// generated route for
/// [SearchResultPage] /// [SearchResultPage]
class SearchResultRoute extends PageRouteInfo<SearchResultRouteArgs> { class SearchResultRoute extends PageRouteInfo<SearchResultRouteArgs> {
SearchResultRoute({Key? key, required String searchTerm}) SearchResultRoute({
: super(SearchResultRoute.name, Key? key,
required String searchTerm,
}) : super(
SearchResultRoute.name,
path: '/search-result-page', path: '/search-result-page',
args: SearchResultRouteArgs(key: key, searchTerm: searchTerm)); args: SearchResultRouteArgs(
key: key,
searchTerm: searchTerm,
),
);
static const String name = 'SearchResultRoute'; static const String name = 'SearchResultRoute';
} }
class SearchResultRouteArgs { class SearchResultRouteArgs {
const SearchResultRouteArgs({this.key, required this.searchTerm}); const SearchResultRouteArgs({
this.key,
required this.searchTerm,
});
final Key? key; final Key? key;
@ -364,21 +590,29 @@ class SearchResultRouteArgs {
/// generated route for /// generated route for
/// [CreateAlbumPage] /// [CreateAlbumPage]
class CreateAlbumRoute extends PageRouteInfo<CreateAlbumRouteArgs> { class CreateAlbumRoute extends PageRouteInfo<CreateAlbumRouteArgs> {
CreateAlbumRoute( CreateAlbumRoute({
{Key? key, required bool isSharedAlbum, List<Asset>? initialAssets}) Key? key,
: super(CreateAlbumRoute.name, required bool isSharedAlbum,
List<Asset>? initialAssets,
}) : super(
CreateAlbumRoute.name,
path: '/create-album-page', path: '/create-album-page',
args: CreateAlbumRouteArgs( args: CreateAlbumRouteArgs(
key: key, key: key,
isSharedAlbum: isSharedAlbum, isSharedAlbum: isSharedAlbum,
initialAssets: initialAssets)); initialAssets: initialAssets,
),
);
static const String name = 'CreateAlbumRoute'; static const String name = 'CreateAlbumRoute';
} }
class CreateAlbumRouteArgs { class CreateAlbumRouteArgs {
const CreateAlbumRouteArgs( const CreateAlbumRouteArgs({
{this.key, required this.isSharedAlbum, this.initialAssets}); this.key,
required this.isSharedAlbum,
this.initialAssets,
});
final Key? key; final Key? key;
@ -395,7 +629,11 @@ class CreateAlbumRouteArgs {
/// generated route for /// generated route for
/// [FavoritesPage] /// [FavoritesPage]
class FavoritesRoute extends PageRouteInfo<void> { class FavoritesRoute extends PageRouteInfo<void> {
const FavoritesRoute() : super(FavoritesRoute.name, path: '/favorites-page'); const FavoritesRoute()
: super(
FavoritesRoute.name,
path: '/favorites-page',
);
static const String name = 'FavoritesRoute'; static const String name = 'FavoritesRoute';
} }
@ -404,7 +642,10 @@ class FavoritesRoute extends PageRouteInfo<void> {
/// [AssetSelectionPage] /// [AssetSelectionPage]
class AssetSelectionRoute extends PageRouteInfo<void> { class AssetSelectionRoute extends PageRouteInfo<void> {
const AssetSelectionRoute() const AssetSelectionRoute()
: super(AssetSelectionRoute.name, path: '/asset-selection-page'); : super(
AssetSelectionRoute.name,
path: '/asset-selection-page',
);
static const String name = 'AssetSelectionRoute'; static const String name = 'AssetSelectionRoute';
} }
@ -413,8 +654,10 @@ class AssetSelectionRoute extends PageRouteInfo<void> {
/// [SelectUserForSharingPage] /// [SelectUserForSharingPage]
class SelectUserForSharingRoute extends PageRouteInfo<void> { class SelectUserForSharingRoute extends PageRouteInfo<void> {
const SelectUserForSharingRoute() const SelectUserForSharingRoute()
: super(SelectUserForSharingRoute.name, : super(
path: '/select-user-for-sharing-page'); SelectUserForSharingRoute.name,
path: '/select-user-for-sharing-page',
);
static const String name = 'SelectUserForSharingRoute'; static const String name = 'SelectUserForSharingRoute';
} }
@ -422,16 +665,26 @@ class SelectUserForSharingRoute extends PageRouteInfo<void> {
/// generated route for /// generated route for
/// [AlbumViewerPage] /// [AlbumViewerPage]
class AlbumViewerRoute extends PageRouteInfo<AlbumViewerRouteArgs> { class AlbumViewerRoute extends PageRouteInfo<AlbumViewerRouteArgs> {
AlbumViewerRoute({Key? key, required String albumId}) AlbumViewerRoute({
: super(AlbumViewerRoute.name, Key? key,
required String albumId,
}) : super(
AlbumViewerRoute.name,
path: '/album-viewer-page', path: '/album-viewer-page',
args: AlbumViewerRouteArgs(key: key, albumId: albumId)); args: AlbumViewerRouteArgs(
key: key,
albumId: albumId,
),
);
static const String name = 'AlbumViewerRoute'; static const String name = 'AlbumViewerRoute';
} }
class AlbumViewerRouteArgs { class AlbumViewerRouteArgs {
const AlbumViewerRouteArgs({this.key, required this.albumId}); const AlbumViewerRouteArgs({
this.key,
required this.albumId,
});
final Key? key; final Key? key;
@ -447,18 +700,26 @@ class AlbumViewerRouteArgs {
/// [SelectAdditionalUserForSharingPage] /// [SelectAdditionalUserForSharingPage]
class SelectAdditionalUserForSharingRoute class SelectAdditionalUserForSharingRoute
extends PageRouteInfo<SelectAdditionalUserForSharingRouteArgs> { extends PageRouteInfo<SelectAdditionalUserForSharingRouteArgs> {
SelectAdditionalUserForSharingRoute({Key? key, required Album album}) SelectAdditionalUserForSharingRoute({
: super(SelectAdditionalUserForSharingRoute.name, Key? key,
required Album album,
}) : super(
SelectAdditionalUserForSharingRoute.name,
path: '/select-additional-user-for-sharing-page', path: '/select-additional-user-for-sharing-page',
args: SelectAdditionalUserForSharingRouteArgs( args: SelectAdditionalUserForSharingRouteArgs(
key: key, album: album)); key: key,
album: album,
),
);
static const String name = 'SelectAdditionalUserForSharingRoute'; static const String name = 'SelectAdditionalUserForSharingRoute';
} }
class SelectAdditionalUserForSharingRouteArgs { class SelectAdditionalUserForSharingRouteArgs {
const SelectAdditionalUserForSharingRouteArgs( const SelectAdditionalUserForSharingRouteArgs({
{this.key, required this.album}); this.key,
required this.album,
});
final Key? key; final Key? key;
@ -474,8 +735,10 @@ class SelectAdditionalUserForSharingRouteArgs {
/// [BackupAlbumSelectionPage] /// [BackupAlbumSelectionPage]
class BackupAlbumSelectionRoute extends PageRouteInfo<void> { class BackupAlbumSelectionRoute extends PageRouteInfo<void> {
const BackupAlbumSelectionRoute() const BackupAlbumSelectionRoute()
: super(BackupAlbumSelectionRoute.name, : super(
path: '/backup-album-selection-page'); BackupAlbumSelectionRoute.name,
path: '/backup-album-selection-page',
);
static const String name = 'BackupAlbumSelectionRoute'; static const String name = 'BackupAlbumSelectionRoute';
} }
@ -483,16 +746,26 @@ class BackupAlbumSelectionRoute extends PageRouteInfo<void> {
/// generated route for /// generated route for
/// [AlbumPreviewPage] /// [AlbumPreviewPage]
class AlbumPreviewRoute extends PageRouteInfo<AlbumPreviewRouteArgs> { class AlbumPreviewRoute extends PageRouteInfo<AlbumPreviewRouteArgs> {
AlbumPreviewRoute({Key? key, required AssetPathEntity album}) AlbumPreviewRoute({
: super(AlbumPreviewRoute.name, Key? key,
required AssetPathEntity album,
}) : super(
AlbumPreviewRoute.name,
path: '/album-preview-page', path: '/album-preview-page',
args: AlbumPreviewRouteArgs(key: key, album: album)); args: AlbumPreviewRouteArgs(
key: key,
album: album,
),
);
static const String name = 'AlbumPreviewRoute'; static const String name = 'AlbumPreviewRoute';
} }
class AlbumPreviewRouteArgs { class AlbumPreviewRouteArgs {
const AlbumPreviewRouteArgs({this.key, required this.album}); const AlbumPreviewRouteArgs({
this.key,
required this.album,
});
final Key? key; final Key? key;
@ -508,7 +781,10 @@ class AlbumPreviewRouteArgs {
/// [FailedBackupStatusPage] /// [FailedBackupStatusPage]
class FailedBackupStatusRoute extends PageRouteInfo<void> { class FailedBackupStatusRoute extends PageRouteInfo<void> {
const FailedBackupStatusRoute() const FailedBackupStatusRoute()
: super(FailedBackupStatusRoute.name, path: '/failed-backup-status-page'); : super(
FailedBackupStatusRoute.name,
path: '/failed-backup-status-page',
);
static const String name = 'FailedBackupStatusRoute'; static const String name = 'FailedBackupStatusRoute';
} }
@ -516,7 +792,11 @@ class FailedBackupStatusRoute extends PageRouteInfo<void> {
/// generated route for /// generated route for
/// [SettingsPage] /// [SettingsPage]
class SettingsRoute extends PageRouteInfo<void> { class SettingsRoute extends PageRouteInfo<void> {
const SettingsRoute() : super(SettingsRoute.name, path: '/settings-page'); const SettingsRoute()
: super(
SettingsRoute.name,
path: '/settings-page',
);
static const String name = 'SettingsRoute'; static const String name = 'SettingsRoute';
} }
@ -524,7 +804,11 @@ class SettingsRoute extends PageRouteInfo<void> {
/// generated route for /// generated route for
/// [AppLogPage] /// [AppLogPage]
class AppLogRoute extends PageRouteInfo<void> { class AppLogRoute extends PageRouteInfo<void> {
const AppLogRoute() : super(AppLogRoute.name, path: '/app-log-page'); const AppLogRoute()
: super(
AppLogRoute.name,
path: '/app-log-page',
);
static const String name = 'AppLogRoute'; static const String name = 'AppLogRoute';
} }
@ -532,7 +816,11 @@ class AppLogRoute extends PageRouteInfo<void> {
/// generated route for /// generated route for
/// [HomePage] /// [HomePage]
class HomeRoute extends PageRouteInfo<void> { class HomeRoute extends PageRouteInfo<void> {
const HomeRoute() : super(HomeRoute.name, path: 'home-page'); const HomeRoute()
: super(
HomeRoute.name,
path: 'home-page',
);
static const String name = 'HomeRoute'; static const String name = 'HomeRoute';
} }
@ -541,8 +829,11 @@ class HomeRoute extends PageRouteInfo<void> {
/// [SearchPage] /// [SearchPage]
class SearchRoute extends PageRouteInfo<SearchRouteArgs> { class SearchRoute extends PageRouteInfo<SearchRouteArgs> {
SearchRoute({Key? key}) SearchRoute({Key? key})
: super(SearchRoute.name, : super(
path: 'search-page', args: SearchRouteArgs(key: key)); SearchRoute.name,
path: 'search-page',
args: SearchRouteArgs(key: key),
);
static const String name = 'SearchRoute'; static const String name = 'SearchRoute';
} }
@ -561,7 +852,11 @@ class SearchRouteArgs {
/// generated route for /// generated route for
/// [SharingPage] /// [SharingPage]
class SharingRoute extends PageRouteInfo<void> { class SharingRoute extends PageRouteInfo<void> {
const SharingRoute() : super(SharingRoute.name, path: 'sharing-page'); const SharingRoute()
: super(
SharingRoute.name,
path: 'sharing-page',
);
static const String name = 'SharingRoute'; static const String name = 'SharingRoute';
} }
@ -569,7 +864,11 @@ class SharingRoute extends PageRouteInfo<void> {
/// generated route for /// generated route for
/// [LibraryPage] /// [LibraryPage]
class LibraryRoute extends PageRouteInfo<void> { class LibraryRoute extends PageRouteInfo<void> {
const LibraryRoute() : super(LibraryRoute.name, path: 'library-page'); const LibraryRoute()
: super(
LibraryRoute.name,
path: 'library-page',
);
static const String name = 'LibraryRoute'; static const String name = 'LibraryRoute';
} }