mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
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>
This commit is contained in:
parent
984feafb90
commit
ba5cca9348
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart' hide Store;
|
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/modules/asset_viewer/providers/current_asset.provider.dart';
|
||||||
import 'package:immich_mobile/shared/providers/user.provider.dart';
|
import 'package:immich_mobile/shared/providers/user.provider.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class ActivitiesPage extends HookConsumerWidget {
|
class ActivitiesPage extends HookConsumerWidget {
|
||||||
const ActivitiesPage({
|
const ActivitiesPage({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -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/ui/user_circle_avatar.dart';
|
||||||
import 'package:immich_mobile/shared/views/immich_loading_overlay.dart';
|
import 'package:immich_mobile/shared/views/immich_loading_overlay.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class AlbumOptionsPage extends HookConsumerWidget {
|
class AlbumOptionsPage extends HookConsumerWidget {
|
||||||
final Album album;
|
final Album album;
|
||||||
|
|
||||||
|
@ -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/ui/user_circle_avatar.dart';
|
||||||
import 'package:immich_mobile/shared/views/immich_loading_overlay.dart';
|
import 'package:immich_mobile/shared/views/immich_loading_overlay.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class AlbumViewerPage extends HookConsumerWidget {
|
class AlbumViewerPage extends HookConsumerWidget {
|
||||||
final int albumId;
|
final int albumId;
|
||||||
|
|
||||||
|
@ -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:immich_mobile/shared/models/asset.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
|
|
||||||
|
@RoutePage<AssetSelectionPageResult?>()
|
||||||
class AssetSelectionPage extends HookConsumerWidget {
|
class AssetSelectionPage extends HookConsumerWidget {
|
||||||
const AssetSelectionPage({
|
const AssetSelectionPage({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -14,6 +14,7 @@ import 'package:immich_mobile/routing/router.dart';
|
|||||||
import 'package:immich_mobile/shared/models/asset.dart';
|
import 'package:immich_mobile/shared/models/asset.dart';
|
||||||
import 'package:immich_mobile/shared/providers/asset.provider.dart';
|
import 'package:immich_mobile/shared/providers/asset.provider.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class CreateAlbumPage extends HookConsumerWidget {
|
class CreateAlbumPage extends HookConsumerWidget {
|
||||||
final bool isSharedAlbum;
|
final bool isSharedAlbum;
|
||||||
|
@ -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/providers/server_info.provider.dart';
|
||||||
import 'package:immich_mobile/shared/ui/immich_app_bar.dart';
|
import 'package:immich_mobile/shared/ui/immich_app_bar.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class LibraryPage extends HookConsumerWidget {
|
class LibraryPage extends HookConsumerWidget {
|
||||||
const LibraryPage({Key? key}) : super(key: key);
|
const LibraryPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -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/models/user.dart';
|
||||||
import 'package:immich_mobile/shared/ui/user_circle_avatar.dart';
|
import 'package:immich_mobile/shared/ui/user_circle_avatar.dart';
|
||||||
|
|
||||||
|
@RoutePage<List<String>?>()
|
||||||
class SelectAdditionalUserForSharingPage extends HookConsumerWidget {
|
class SelectAdditionalUserForSharingPage extends HookConsumerWidget {
|
||||||
final Album album;
|
final Album album;
|
||||||
|
|
||||||
|
@ -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/models/user.dart';
|
||||||
import 'package:immich_mobile/shared/ui/user_circle_avatar.dart';
|
import 'package:immich_mobile/shared/ui/user_circle_avatar.dart';
|
||||||
|
|
||||||
|
@RoutePage<List<String>>()
|
||||||
class SelectUserForSharingPage extends HookConsumerWidget {
|
class SelectUserForSharingPage extends HookConsumerWidget {
|
||||||
const SelectUserForSharingPage({Key? key, required this.assets})
|
const SelectUserForSharingPage({Key? key, required this.assets})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
@ -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_app_bar.dart';
|
||||||
import 'package:immich_mobile/shared/ui/immich_image.dart';
|
import 'package:immich_mobile/shared/ui/immich_image.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class SharingPage extends HookConsumerWidget {
|
class SharingPage extends HookConsumerWidget {
|
||||||
const SharingPage({Key? key}) : super(key: key);
|
const SharingPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -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/modules/home/providers/multiselect.provider.dart';
|
||||||
import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart';
|
import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class ArchivePage extends HookConsumerWidget {
|
class ArchivePage extends HookConsumerWidget {
|
||||||
const ArchivePage({super.key});
|
const ArchivePage({super.key});
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import 'package:immich_mobile/utils/image_url_builder.dart';
|
|||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
import 'package:openapi/api.dart' show ThumbnailFormat;
|
import 'package:openapi/api.dart' show ThumbnailFormat;
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class GalleryViewerPage extends HookConsumerWidget {
|
class GalleryViewerPage extends HookConsumerWidget {
|
||||||
final Asset Function(int index) loadAsset;
|
final Asset Function(int index) loadAsset;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:chewie/chewie.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:video_player/video_player.dart';
|
||||||
import 'package:wakelock_plus/wakelock_plus.dart';
|
import 'package:wakelock_plus/wakelock_plus.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class VideoViewerPage extends HookConsumerWidget {
|
class VideoViewerPage extends HookConsumerWidget {
|
||||||
final Asset asset;
|
final Asset asset;
|
||||||
|
@ -7,6 +7,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|||||||
import 'package:immich_mobile/shared/ui/immich_loading_indicator.dart';
|
import 'package:immich_mobile/shared/ui/immich_loading_indicator.dart';
|
||||||
import 'package:photo_manager/photo_manager.dart';
|
import 'package:photo_manager/photo_manager.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class AlbumPreviewPage extends HookConsumerWidget {
|
class AlbumPreviewPage extends HookConsumerWidget {
|
||||||
final AssetPathEntity album;
|
final AssetPathEntity album;
|
||||||
const AlbumPreviewPage({Key? key, required this.album}) : super(key: key);
|
const AlbumPreviewPage({Key? key, required this.album}) : super(key: key);
|
||||||
|
@ -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/modules/backup/ui/album_info_list_tile.dart';
|
||||||
import 'package:immich_mobile/shared/ui/immich_loading_indicator.dart';
|
import 'package:immich_mobile/shared/ui/immich_loading_indicator.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class BackupAlbumSelectionPage extends HookConsumerWidget {
|
class BackupAlbumSelectionPage extends HookConsumerWidget {
|
||||||
const BackupAlbumSelectionPage({Key? key}) : super(key: key);
|
const BackupAlbumSelectionPage({Key? key}) : super(key: key);
|
||||||
@override
|
@override
|
||||||
|
@ -18,6 +18,7 @@ import 'package:immich_mobile/routing/router.dart';
|
|||||||
import 'package:immich_mobile/shared/providers/websocket.provider.dart';
|
import 'package:immich_mobile/shared/providers/websocket.provider.dart';
|
||||||
import 'package:immich_mobile/modules/backup/ui/backup_info_card.dart';
|
import 'package:immich_mobile/modules/backup/ui/backup_info_card.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class BackupControllerPage extends HookConsumerWidget {
|
class BackupControllerPage extends HookConsumerWidget {
|
||||||
const BackupControllerPage({Key? key}) : super(key: key);
|
const BackupControllerPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import 'package:permission_handler/permission_handler.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:wakelock_plus/wakelock_plus.dart';
|
import 'package:wakelock_plus/wakelock_plus.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class BackupOptionsPage extends HookConsumerWidget {
|
class BackupOptionsPage extends HookConsumerWidget {
|
||||||
const BackupOptionsPage({Key? key}) : super(key: key);
|
const BackupOptionsPage({Key? key}) : super(key: key);
|
||||||
@override
|
@override
|
||||||
|
@ -6,6 +6,7 @@ import 'package:immich_mobile/modules/backup/providers/error_backup_list.provide
|
|||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:photo_manager/photo_manager.dart';
|
import 'package:photo_manager/photo_manager.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class FailedBackupStatusPage extends HookConsumerWidget {
|
class FailedBackupStatusPage extends HookConsumerWidget {
|
||||||
const FailedBackupStatusPage({Key? key}) : super(key: key);
|
const FailedBackupStatusPage({Key? key}) : super(key: key);
|
||||||
@override
|
@override
|
||||||
|
@ -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/modules/home/providers/multiselect.provider.dart';
|
||||||
import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart';
|
import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class FavoritesPage extends HookConsumerWidget {
|
class FavoritesPage extends HookConsumerWidget {
|
||||||
const FavoritesPage({Key? key}) : super(key: key);
|
const FavoritesPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
@ -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_app_bar.dart';
|
||||||
import 'package:immich_mobile/shared/ui/immich_loading_indicator.dart';
|
import 'package:immich_mobile/shared/ui/immich_loading_indicator.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class HomePage extends HookConsumerWidget {
|
class HomePage extends HookConsumerWidget {
|
||||||
const HomePage({Key? key}) : super(key: key);
|
const HomePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ class ChangePasswordForm extends HookConsumerWidget {
|
|||||||
.clearAllAsset();
|
.clearAllAsset();
|
||||||
ref.read(websocketProvider.notifier).disconnect();
|
ref.read(websocketProvider.notifier).disconnect();
|
||||||
|
|
||||||
AutoRouter.of(context).navigateBack();
|
AutoRouter.of(context).back();
|
||||||
|
|
||||||
ImmichToast.show(
|
ImmichToast.show(
|
||||||
context: context,
|
context: context,
|
||||||
@ -111,7 +111,7 @@ class ChangePasswordForm extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
icon: const Icon(Icons.arrow_back),
|
icon: const Icon(Icons.arrow_back),
|
||||||
onPressed: () => AutoRouter.of(context).navigateBack(),
|
onPressed: () => AutoRouter.of(context).back(),
|
||||||
label: const Text('Back'),
|
label: const Text('Back'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:immich_mobile/modules/login/ui/change_password_form.dart';
|
import 'package:immich_mobile/modules/login/ui/change_password_form.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class ChangePasswordPage extends HookConsumerWidget {
|
class ChangePasswordPage extends HookConsumerWidget {
|
||||||
const ChangePasswordPage({Key? key}) : super(key: key);
|
const ChangePasswordPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import 'package:immich_mobile/modules/login/ui/login_form.dart';
|
|||||||
import 'package:immich_mobile/routing/router.dart';
|
import 'package:immich_mobile/routing/router.dart';
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class LoginPage extends HookConsumerWidget {
|
class LoginPage extends HookConsumerWidget {
|
||||||
const LoginPage({Key? key}) : super(key: key);
|
const LoginPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ import 'package:maplibre_gl/maplibre_gl.dart';
|
|||||||
import 'package:immich_mobile/modules/map/utils/map_utils.dart';
|
import 'package:immich_mobile/modules/map/utils/map_utils.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
|
|
||||||
|
@RoutePage<LatLng?>()
|
||||||
class MapLocationPickerPage extends HookConsumerWidget {
|
class MapLocationPickerPage extends HookConsumerWidget {
|
||||||
final LatLng initialLatLng;
|
final LatLng initialLatLng;
|
||||||
|
|
||||||
@ -45,7 +46,8 @@ class MapLocationPickerPage extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getCurrentLocation() async {
|
Future<void> getCurrentLocation() async {
|
||||||
var (currentLocation, locationPermission) = await MapUtils.checkPermAndGetLocation(context);
|
var (currentLocation, locationPermission) =
|
||||||
|
await MapUtils.checkPermAndGetLocation(context);
|
||||||
if (locationPermission == LocationPermission.denied ||
|
if (locationPermission == LocationPermission.denied ||
|
||||||
locationPermission == LocationPermission.deniedForever) {
|
locationPermission == LocationPermission.deniedForever) {
|
||||||
return;
|
return;
|
||||||
@ -53,7 +55,8 @@ class MapLocationPickerPage extends HookConsumerWidget {
|
|||||||
if (currentLocation == null) {
|
if (currentLocation == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var currentLatLng = LatLng(currentLocation.latitude, currentLocation.longitude);
|
var currentLatLng =
|
||||||
|
LatLng(currentLocation.latitude, currentLocation.longitude);
|
||||||
selectedLatLng.value = currentLatLng;
|
selectedLatLng.value = currentLatLng;
|
||||||
controller.value?.animateCamera(CameraUpdate.newLatLng(currentLatLng));
|
controller.value?.animateCamera(CameraUpdate.newLatLng(currentLatLng));
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ import 'package:immich_mobile/shared/views/immich_loading_overlay.dart';
|
|||||||
import 'package:immich_mobile/utils/debounce.dart';
|
import 'package:immich_mobile/utils/debounce.dart';
|
||||||
import 'package:maplibre_gl/maplibre_gl.dart';
|
import 'package:maplibre_gl/maplibre_gl.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class MapPage extends HookConsumerWidget {
|
class MapPage extends HookConsumerWidget {
|
||||||
const MapPage({super.key});
|
const MapPage({super.key});
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import 'package:immich_mobile/shared/ui/immich_image.dart';
|
|||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:openapi/api.dart' as api;
|
import 'package:openapi/api.dart' as api;
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class MemoryPage extends HookConsumerWidget {
|
class MemoryPage extends HookConsumerWidget {
|
||||||
final List<Memory> memories;
|
final List<Memory> memories;
|
||||||
final int memoryIndex;
|
final int memoryIndex;
|
||||||
|
@ -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:immich_mobile/shared/ui/immich_title_text.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class PermissionOnboardingPage extends HookConsumerWidget {
|
class PermissionOnboardingPage extends HookConsumerWidget {
|
||||||
const PermissionOnboardingPage({super.key});
|
const PermissionOnboardingPage({super.key});
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
@ -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/asset_grid/multiselect_grid.dart';
|
||||||
import 'package:immich_mobile/shared/ui/immich_toast.dart';
|
import 'package:immich_mobile/shared/ui/immich_toast.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class PartnerDetailPage extends HookConsumerWidget {
|
class PartnerDetailPage extends HookConsumerWidget {
|
||||||
const PartnerDetailPage({Key? key, required this.partner}) : super(key: key);
|
const PartnerDetailPage({Key? key, required this.partner}) : super(key: key);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
@ -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/immich_toast.dart';
|
||||||
import 'package:immich_mobile/shared/ui/user_avatar.dart';
|
import 'package:immich_mobile/shared/ui/user_avatar.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class PartnerPage extends HookConsumerWidget {
|
class PartnerPage extends HookConsumerWidget {
|
||||||
const PartnerPage({Key? key}) : super(key: key);
|
const PartnerPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -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/home/ui/asset_grid/immich_asset_grid.dart';
|
||||||
import 'package:immich_mobile/modules/search/providers/all_motion_photos.provider.dart';
|
import 'package:immich_mobile/modules/search/providers/all_motion_photos.provider.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class AllMotionPhotosPage extends HookConsumerWidget {
|
class AllMotionPhotosPage extends HookConsumerWidget {
|
||||||
const AllMotionPhotosPage({super.key});
|
const AllMotionPhotosPage({super.key});
|
||||||
|
|
||||||
|
@ -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/providers/people.provider.dart';
|
||||||
import 'package:immich_mobile/modules/search/ui/explore_grid.dart';
|
import 'package:immich_mobile/modules/search/ui/explore_grid.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class AllPeoplePage extends HookConsumerWidget {
|
class AllPeoplePage extends HookConsumerWidget {
|
||||||
const AllPeoplePage({super.key});
|
const AllPeoplePage({super.key});
|
||||||
|
|
||||||
|
@ -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/modules/search/providers/all_video_assets.provider.dart';
|
||||||
import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart';
|
import 'package:immich_mobile/shared/ui/asset_grid/multiselect_grid.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class AllVideosPage extends HookConsumerWidget {
|
class AllVideosPage extends HookConsumerWidget {
|
||||||
const AllVideosPage({super.key});
|
const AllVideosPage({super.key});
|
||||||
|
|
||||||
|
@ -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:immich_mobile/modules/search/ui/explore_grid.dart';
|
||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class CuratedLocationPage extends HookConsumerWidget {
|
class CuratedLocationPage extends HookConsumerWidget {
|
||||||
const CuratedLocationPage({super.key});
|
const CuratedLocationPage({super.key});
|
||||||
|
|
||||||
|
@ -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/shared/ui/asset_grid/multiselect_grid.dart';
|
||||||
import 'package:immich_mobile/utils/image_url_builder.dart';
|
import 'package:immich_mobile/utils/image_url_builder.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class PersonResultPage extends HookConsumerWidget {
|
class PersonResultPage extends HookConsumerWidget {
|
||||||
final String personId;
|
final String personId;
|
||||||
final String personName;
|
final String personName;
|
||||||
|
@ -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/home/ui/asset_grid/immich_asset_grid.dart';
|
||||||
import 'package:immich_mobile/modules/search/providers/recently_added.provider.dart';
|
import 'package:immich_mobile/modules/search/providers/recently_added.provider.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class RecentlyAddedPage extends HookConsumerWidget {
|
class RecentlyAddedPage extends HookConsumerWidget {
|
||||||
const RecentlyAddedPage({super.key});
|
const RecentlyAddedPage({super.key});
|
||||||
|
|
||||||
|
@ -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/providers/server_info.provider.dart';
|
||||||
import 'package:immich_mobile/shared/ui/scaffold_error_body.dart';
|
import 'package:immich_mobile/shared/ui/scaffold_error_body.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class SearchPage extends HookConsumerWidget {
|
class SearchPage extends HookConsumerWidget {
|
||||||
SearchPage({Key? key}) : super(key: key);
|
SearchPage({Key? key}) : super(key: key);
|
||||||
|
@ -25,6 +25,7 @@ SearchType _getSearchType(String searchTerm) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class SearchResultPage extends HookConsumerWidget {
|
class SearchResultPage extends HookConsumerWidget {
|
||||||
const SearchResultPage({
|
const SearchResultPage({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
@ -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/notification_setting/notification_setting.dart';
|
||||||
import 'package:immich_mobile/modules/settings/ui/theme_setting/theme_setting.dart';
|
import 'package:immich_mobile/modules/settings/ui/theme_setting/theme_setting.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class SettingsPage extends HookConsumerWidget {
|
class SettingsPage extends HookConsumerWidget {
|
||||||
const SettingsPage({Key? key}) : super(key: key);
|
const SettingsPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -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/shared/ui/immich_toast.dart';
|
||||||
import 'package:immich_mobile/utils/url_helper.dart';
|
import 'package:immich_mobile/utils/url_helper.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class SharedLinkEditPage extends HookConsumerWidget {
|
class SharedLinkEditPage extends HookConsumerWidget {
|
||||||
final SharedLink? existingLink;
|
final SharedLink? existingLink;
|
||||||
final List<String>? assetsList;
|
final List<String>? assetsList;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
@ -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/providers/shared_link.provider.dart';
|
||||||
import 'package:immich_mobile/modules/shared_link/ui/shared_link_item.dart';
|
import 'package:immich_mobile/modules/shared_link/ui/shared_link_item.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class SharedLinkPage extends HookConsumerWidget {
|
class SharedLinkPage extends HookConsumerWidget {
|
||||||
const SharedLinkPage({Key? key}) : super(key: key);
|
const SharedLinkPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -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/ui/immich_toast.dart';
|
||||||
import 'package:immich_mobile/shared/views/immich_loading_overlay.dart';
|
import 'package:immich_mobile/shared/views/immich_loading_overlay.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class TrashPage extends HookConsumerWidget {
|
class TrashPage extends HookConsumerWidget {
|
||||||
const TrashPage({super.key});
|
const TrashPage({super.key});
|
||||||
|
|
||||||
|
@ -64,137 +64,164 @@ import 'package:photo_manager/photo_manager.dart' hide LatLng;
|
|||||||
|
|
||||||
part 'router.gr.dart';
|
part 'router.gr.dart';
|
||||||
|
|
||||||
@MaterialAutoRouter(
|
@AutoRouterConfig(replaceInRouteName: 'Page,Route')
|
||||||
replaceInRouteName: 'Page,Route',
|
class AppRouter extends _$AppRouter {
|
||||||
routes: <AutoRoute>[
|
late final AuthGuard _authGuard;
|
||||||
AutoRoute(page: SplashScreenPage, initial: true),
|
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<AutoRoute> routes = [
|
||||||
|
AutoRoute(page: SplashScreenRoute.page, initial: true),
|
||||||
AutoRoute(
|
AutoRoute(
|
||||||
page: PermissionOnboardingPage,
|
page: PermissionOnboardingRoute.page,
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
guards: [_authGuard, _duplicateGuard],
|
||||||
),
|
),
|
||||||
AutoRoute(
|
AutoRoute(page: LoginRoute.page, guards: [_duplicateGuard]),
|
||||||
page: LoginPage,
|
AutoRoute(page: ChangePasswordRoute.page),
|
||||||
guards: [
|
|
||||||
DuplicateGuard,
|
|
||||||
],
|
|
||||||
),
|
|
||||||
AutoRoute(page: ChangePasswordPage),
|
|
||||||
CustomRoute(
|
CustomRoute(
|
||||||
page: TabControllerPage,
|
page: TabControllerRoute.page,
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
guards: [_authGuard, _duplicateGuard],
|
||||||
children: [
|
children: [
|
||||||
AutoRoute(page: HomePage, guards: [AuthGuard, DuplicateGuard]),
|
AutoRoute(page: HomeRoute.page, guards: [_authGuard, _duplicateGuard]),
|
||||||
AutoRoute(page: SearchPage, guards: [AuthGuard, DuplicateGuard]),
|
AutoRoute(
|
||||||
AutoRoute(page: SharingPage, guards: [AuthGuard, DuplicateGuard]),
|
page: SearchRoute.page,
|
||||||
AutoRoute(page: LibraryPage, guards: [AuthGuard, DuplicateGuard]),
|
guards: [_authGuard, _duplicateGuard],
|
||||||
|
),
|
||||||
|
AutoRoute(
|
||||||
|
page: SharingRoute.page,
|
||||||
|
guards: [_authGuard, _duplicateGuard],
|
||||||
|
),
|
||||||
|
AutoRoute(
|
||||||
|
page: LibraryRoute.page,
|
||||||
|
guards: [_authGuard, _duplicateGuard],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
transitionsBuilder: TransitionsBuilders.fadeIn,
|
transitionsBuilder: TransitionsBuilders.fadeIn,
|
||||||
),
|
),
|
||||||
CustomRoute(
|
CustomRoute(
|
||||||
page: GalleryViewerPage,
|
page: GalleryViewerRoute.page,
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
guards: [_authGuard, _duplicateGuard],
|
||||||
transitionsBuilder: CustomTransitionsBuilders.zoomedPage,
|
transitionsBuilder: CustomTransitionsBuilders.zoomedPage,
|
||||||
),
|
),
|
||||||
AutoRoute(page: VideoViewerPage, guards: [AuthGuard, DuplicateGuard]),
|
|
||||||
AutoRoute(
|
AutoRoute(
|
||||||
page: BackupControllerPage,
|
page: VideoViewerRoute.page,
|
||||||
guards: [AuthGuard, DuplicateGuard, BackupPermissionGuard],
|
guards: [_authGuard, _duplicateGuard],
|
||||||
),
|
|
||||||
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<AssetSelectionPageResult?>(
|
|
||||||
page: AssetSelectionPage,
|
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
|
||||||
transitionsBuilder: TransitionsBuilders.slideBottom,
|
|
||||||
),
|
|
||||||
CustomRoute<List<String>>(
|
|
||||||
page: SelectUserForSharingPage,
|
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
|
||||||
transitionsBuilder: TransitionsBuilders.slideBottom,
|
|
||||||
),
|
|
||||||
AutoRoute(page: AlbumViewerPage, guards: [AuthGuard, DuplicateGuard]),
|
|
||||||
CustomRoute<List<String>?>(
|
|
||||||
page: SelectAdditionalUserForSharingPage,
|
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
|
||||||
transitionsBuilder: TransitionsBuilders.slideBottom,
|
|
||||||
),
|
),
|
||||||
AutoRoute(
|
AutoRoute(
|
||||||
page: BackupAlbumSelectionPage,
|
page: BackupControllerRoute.page,
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
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(
|
CustomRoute(
|
||||||
page: FailedBackupStatusPage,
|
page: AssetSelectionRoute.page,
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
guards: [_authGuard, _duplicateGuard],
|
||||||
|
transitionsBuilder: TransitionsBuilders.slideBottom,
|
||||||
|
),
|
||||||
|
CustomRoute(
|
||||||
|
page: SelectUserForSharingRoute.page,
|
||||||
|
guards: [_authGuard, _duplicateGuard],
|
||||||
transitionsBuilder: TransitionsBuilders.slideBottom,
|
transitionsBuilder: TransitionsBuilders.slideBottom,
|
||||||
),
|
),
|
||||||
AutoRoute(
|
AutoRoute(
|
||||||
page: SettingsPage,
|
page: AlbumViewerRoute.page,
|
||||||
guards: [
|
guards: [_authGuard, _duplicateGuard],
|
||||||
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(
|
CustomRoute(
|
||||||
page: ActivitiesPage,
|
page: SelectAdditionalUserForSharingRoute.page,
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
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,
|
transitionsBuilder: TransitionsBuilders.slideLeft,
|
||||||
durationInMilliseconds: 200,
|
durationInMilliseconds: 200,
|
||||||
),
|
),
|
||||||
CustomRoute<LatLng?>(
|
CustomRoute(
|
||||||
page: MapLocationPickerPage,
|
page: MapLocationPickerRoute.page,
|
||||||
guards: [AuthGuard, DuplicateGuard],
|
guards: [_authGuard, _duplicateGuard],
|
||||||
),
|
),
|
||||||
AutoRoute(page: BackupOptionsPage, guards: [AuthGuard, DuplicateGuard]),
|
AutoRoute(
|
||||||
],
|
page: BackupOptionsRoute.page,
|
||||||
)
|
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),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final appRouterProvider = Provider(
|
final appRouterProvider = Provider(
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,11 @@
|
|||||||
|
import 'package:auto_route/auto_route.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
||||||
import 'package:immich_mobile/shared/models/logger_message.model.dart';
|
import 'package:immich_mobile/shared/models/logger_message.model.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class AppLogDetailPage extends HookConsumerWidget {
|
class AppLogDetailPage extends HookConsumerWidget {
|
||||||
const AppLogDetailPage({super.key, required this.logMessage});
|
const AppLogDetailPage({super.key, required this.logMessage});
|
||||||
|
|
||||||
|
@ -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:immich_mobile/shared/services/immich_logger.service.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class AppLogPage extends HookConsumerWidget {
|
class AppLogPage extends HookConsumerWidget {
|
||||||
const AppLogPage({
|
const AppLogPage({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -11,6 +11,7 @@ import 'package:immich_mobile/shared/providers/api.provider.dart';
|
|||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class SplashScreenPage extends HookConsumerWidget {
|
class SplashScreenPage extends HookConsumerWidget {
|
||||||
const SplashScreenPage({Key? key}) : super(key: key);
|
const SplashScreenPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -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/asset.provider.dart';
|
||||||
import 'package:immich_mobile/shared/providers/tab.provider.dart';
|
import 'package:immich_mobile/shared/providers/tab.provider.dart';
|
||||||
|
|
||||||
|
@RoutePage()
|
||||||
class TabControllerPage extends HookConsumerWidget {
|
class TabControllerPage extends HookConsumerWidget {
|
||||||
const TabControllerPage({Key? key}) : super(key: key);
|
const TabControllerPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@ -167,6 +168,15 @@ class TabControllerPage extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> returnBackToHome(TabsRouter tabsRouter) async {
|
||||||
|
bool atHomeTab = tabsRouter.activeIndex == 0;
|
||||||
|
if (!atHomeTab) {
|
||||||
|
tabsRouter.setActiveIndex(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return atHomeTab;
|
||||||
|
}
|
||||||
|
|
||||||
final multiselectEnabled = ref.watch(multiselectProvider);
|
final multiselectEnabled = ref.watch(multiselectProvider);
|
||||||
return AutoTabsRouter(
|
return AutoTabsRouter(
|
||||||
routes: [
|
routes: [
|
||||||
@ -175,17 +185,15 @@ class TabControllerPage extends HookConsumerWidget {
|
|||||||
const SharingRoute(),
|
const SharingRoute(),
|
||||||
const LibraryRoute(),
|
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);
|
final tabsRouter = AutoTabsRouter.of(context);
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () => returnBackToHome(tabsRouter),
|
||||||
bool atHomeTab = tabsRouter.activeIndex == 0;
|
|
||||||
if (!atHomeTab) {
|
|
||||||
tabsRouter.setActiveIndex(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return atHomeTab;
|
|
||||||
},
|
|
||||||
child: LayoutBuilder(
|
child: LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
const medium = 600;
|
const medium = 600;
|
||||||
@ -194,22 +202,14 @@ class TabControllerPage extends HookConsumerWidget {
|
|||||||
if (constraints.maxWidth < medium) {
|
if (constraints.maxWidth < medium) {
|
||||||
// Normal phone width
|
// Normal phone width
|
||||||
bottom = bottomNavigationBar(tabsRouter);
|
bottom = bottomNavigationBar(tabsRouter);
|
||||||
body = FadeTransition(
|
body = child;
|
||||||
opacity: animation,
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
// Medium tablet width
|
// Medium tablet width
|
||||||
bottom = null;
|
bottom = null;
|
||||||
body = Row(
|
body = Row(
|
||||||
children: [
|
children: [
|
||||||
navigationRail(tabsRouter),
|
navigationRail(tabsRouter),
|
||||||
Expanded(
|
Expanded(child: child),
|
||||||
child: FadeTransition(
|
|
||||||
opacity: animation,
|
|
||||||
child: child,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -61,18 +61,18 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: auto_route
|
name: auto_route
|
||||||
sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d"
|
sha256: "82f8df1d177416bc6b7a449127d0270ff1f0f633a91f2ceb7a85d4f07c3affa1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.4"
|
version: "7.8.4"
|
||||||
auto_route_generator:
|
auto_route_generator:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: auto_route_generator
|
name: auto_route_generator
|
||||||
sha256: de5bfbc02ae4eebb339dd90d325749ae7536e903f6513ef72b88954072d72b0e
|
sha256: "11067a3bcd643812518fe26c0c9ec073990286cabfd9d74b6da9ef9b913c4d22"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.3"
|
version: "7.3.2"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1717,4 +1717,4 @@ packages:
|
|||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.1.0-185.0.dev <4.0.0"
|
dart: ">=3.1.0-185.0.dev <4.0.0"
|
||||||
flutter: ">=3.10.0"
|
flutter: ">=3.13.0"
|
||||||
|
@ -20,7 +20,7 @@ dependencies:
|
|||||||
cached_network_image: ^3.2.2
|
cached_network_image: ^3.2.2
|
||||||
flutter_cache_manager: ^3.3.0
|
flutter_cache_manager: ^3.3.0
|
||||||
intl: ^0.18.0
|
intl: ^0.18.0
|
||||||
auto_route: ^5.0.1
|
auto_route: ^7.0.0
|
||||||
fluttertoast: ^8.2.2
|
fluttertoast: ^8.2.2
|
||||||
video_player: ^2.2.18
|
video_player: ^2.2.18
|
||||||
chewie: ^1.4.0
|
chewie: ^1.4.0
|
||||||
@ -76,7 +76,7 @@ dev_dependencies:
|
|||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_lints: ^2.0.1
|
flutter_lints: ^2.0.1
|
||||||
build_runner: ^2.2.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_launcher_icons: ^0.13.1
|
||||||
flutter_native_splash: ^2.2.16
|
flutter_native_splash: ^2.2.16
|
||||||
isar_generator: *isar_version
|
isar_generator: *isar_version
|
||||||
|
Loading…
Reference in New Issue
Block a user