mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-26 08:12:33 -04:00 
			
		
		
		
	* fix: exclude albums filter in backup provider * refactor: Separate builder methods for Top Control App Bar buttons * fix: Show download button only for Remote only assets * fix(mobile): Force Refresh duration is too low to trigger it consistently * feat(mobile): Make Buttons dynamic in Home Selection DraggableScrollableSheet * feat(mobile): Manual Asset upload * refactor(mobile): Replace _showToast with ImmichToast calls * refactor(mobile): home_page selectionAssetState handling * chore(mobile): min and initial size of DraggableScrollState increased This is to prevent the buttons in the bottom sheet getting clipped behind the 3 way navigation buttons in the default density of Android devices * feat(mobile): notifications for manual upload progress * wording --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
		
			
				
	
	
		
			117 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			117 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
| 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';
 | |
| import 'package:immich_mobile/modules/backup/providers/backup.provider.dart';
 | |
| import 'package:immich_mobile/modules/backup/providers/manual_upload.provider.dart';
 | |
| import 'package:immich_mobile/modules/home/ui/profile_drawer/profile_drawer_header.dart';
 | |
| import 'package:immich_mobile/modules/home/ui/profile_drawer/server_info_box.dart';
 | |
| import 'package:immich_mobile/modules/login/providers/authentication.provider.dart';
 | |
| import 'package:immich_mobile/routing/router.dart';
 | |
| import 'package:immich_mobile/shared/providers/asset.provider.dart';
 | |
| import 'package:immich_mobile/shared/providers/websocket.provider.dart';
 | |
| 
 | |
| class ProfileDrawer extends HookConsumerWidget {
 | |
|   const ProfileDrawer({Key? key}) : super(key: key);
 | |
| 
 | |
|   @override
 | |
|   Widget build(BuildContext context, WidgetRef ref) {
 | |
|     buildSignOutButton() {
 | |
|       return ListTile(
 | |
|         leading: SizedBox(
 | |
|           height: double.infinity,
 | |
|           child: Icon(
 | |
|             Icons.logout_rounded,
 | |
|             color: Theme.of(context).textTheme.labelMedium?.color,
 | |
|             size: 20,
 | |
|           ),
 | |
|         ),
 | |
|         title: Text(
 | |
|           "profile_drawer_sign_out",
 | |
|           style: Theme.of(context)
 | |
|               .textTheme
 | |
|               .labelLarge
 | |
|               ?.copyWith(fontWeight: FontWeight.bold),
 | |
|         ).tr(),
 | |
|         onTap: () async {
 | |
|           await ref.watch(authenticationProvider.notifier).logout();
 | |
| 
 | |
|           ref.read(manualUploadProvider.notifier).cancelBackup();
 | |
|           ref.watch(backupProvider.notifier).cancelBackup();
 | |
|           ref.watch(assetProvider.notifier).clearAllAsset();
 | |
|           ref.watch(websocketProvider.notifier).disconnect();
 | |
|           AutoRouter.of(context).replace(const LoginRoute());
 | |
|         },
 | |
|       );
 | |
|     }
 | |
| 
 | |
|     buildSettingButton() {
 | |
|       return ListTile(
 | |
|         leading: SizedBox(
 | |
|           height: double.infinity,
 | |
|           child: Icon(
 | |
|             Icons.settings_rounded,
 | |
|             color: Theme.of(context).textTheme.labelMedium?.color,
 | |
|             size: 20,
 | |
|           ),
 | |
|         ),
 | |
|         title: Text(
 | |
|           "profile_drawer_settings",
 | |
|           style: Theme.of(context)
 | |
|               .textTheme
 | |
|               .labelLarge
 | |
|               ?.copyWith(fontWeight: FontWeight.bold),
 | |
|         ).tr(),
 | |
|         onTap: () {
 | |
|           AutoRouter.of(context).push(const SettingsRoute());
 | |
|         },
 | |
|       );
 | |
|     }
 | |
| 
 | |
|     buildAppLogButton() {
 | |
|       return ListTile(
 | |
|         leading: SizedBox(
 | |
|           height: double.infinity,
 | |
|           child: Icon(
 | |
|             Icons.assignment_outlined,
 | |
|             color: Theme.of(context).textTheme.labelMedium?.color,
 | |
|             size: 20,
 | |
|           ),
 | |
|         ),
 | |
|         title: Text(
 | |
|           "profile_drawer_app_logs",
 | |
|           style: Theme.of(context)
 | |
|               .textTheme
 | |
|               .labelLarge
 | |
|               ?.copyWith(fontWeight: FontWeight.bold),
 | |
|         ).tr(),
 | |
|         onTap: () {
 | |
|           AutoRouter.of(context).push(const AppLogRoute());
 | |
|         },
 | |
|       );
 | |
|     }
 | |
| 
 | |
|     return Drawer(
 | |
|       shape: const RoundedRectangleBorder(
 | |
|         borderRadius: BorderRadius.zero,
 | |
|       ),
 | |
|       child: Column(
 | |
|         mainAxisAlignment: MainAxisAlignment.spaceBetween,
 | |
|         children: [
 | |
|           ListView(
 | |
|             shrinkWrap: true,
 | |
|             padding: EdgeInsets.zero,
 | |
|             children: [
 | |
|               const ProfileDrawerHeader(),
 | |
|               buildSettingButton(),
 | |
|               buildAppLogButton(),
 | |
|               buildSignOutButton(),
 | |
|             ],
 | |
|           ),
 | |
|           const ServerInfoBox()
 | |
|         ],
 | |
|       ),
 | |
|     );
 | |
|   }
 | |
| }
 |