mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-31 02:27:08 -04:00 
			
		
		
		
	fix: optimize code
This commit is contained in:
		
							parent
							
								
									1496627551
								
							
						
					
					
						commit
						f588a609d9
					
				| @ -36,6 +36,10 @@ class BackupAlbumSelectionPage extends HookConsumerWidget { | |||||||
|       [], |       [], | ||||||
|     ); |     ); | ||||||
| 
 | 
 | ||||||
|  |     var filteredAlbums = albums.where((album) { | ||||||
|  |       return album.name.toLowerCase().contains(searchQuery.value.toLowerCase()); | ||||||
|  |     }).toList(); | ||||||
|  | 
 | ||||||
|     buildAlbumSelectionList() { |     buildAlbumSelectionList() { | ||||||
|       if (albums.isEmpty) { |       if (albums.isEmpty) { | ||||||
|         return const SliverToBoxAdapter( |         return const SliverToBoxAdapter( | ||||||
| @ -45,12 +49,6 @@ class BackupAlbumSelectionPage extends HookConsumerWidget { | |||||||
|         ); |         ); | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       var filteredAlbums = albums.where((album) { |  | ||||||
|         return album.name |  | ||||||
|             .toLowerCase() |  | ||||||
|             .contains(searchQuery.value.toLowerCase()); |  | ||||||
|       }).toList(); |  | ||||||
| 
 |  | ||||||
|       return SliverPadding( |       return SliverPadding( | ||||||
|         padding: const EdgeInsets.symmetric(vertical: 12.0), |         padding: const EdgeInsets.symmetric(vertical: 12.0), | ||||||
|         sliver: SliverList( |         sliver: SliverList( | ||||||
| @ -75,12 +73,6 @@ class BackupAlbumSelectionPage extends HookConsumerWidget { | |||||||
|         ); |         ); | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       var filteredAlbums = albums.where((album) { |  | ||||||
|         return album.name |  | ||||||
|             .toLowerCase() |  | ||||||
|             .contains(searchQuery.value.toLowerCase()); |  | ||||||
|       }).toList(); |  | ||||||
| 
 |  | ||||||
|       return SliverPadding( |       return SliverPadding( | ||||||
|         padding: const EdgeInsets.all(12.0), |         padding: const EdgeInsets.all(12.0), | ||||||
|         sliver: SliverGrid.builder( |         sliver: SliverGrid.builder( | ||||||
| @ -262,8 +254,9 @@ class BackupAlbumSelectionPage extends HookConsumerWidget { | |||||||
|                         context: context, |                         context: context, | ||||||
|                         builder: (BuildContext context) { |                         builder: (BuildContext context) { | ||||||
|                           return AlertDialog( |                           return AlertDialog( | ||||||
|                             shape: RoundedRectangleBorder( |                             shape: const RoundedRectangleBorder( | ||||||
|                               borderRadius: BorderRadius.circular(10), |                               borderRadius: | ||||||
|  |                                   BorderRadius.all(Radius.circular(10)), | ||||||
|                             ), |                             ), | ||||||
|                             elevation: 5, |                             elevation: 5, | ||||||
|                             title: Text( |                             title: Text( | ||||||
| @ -292,8 +285,6 @@ class BackupAlbumSelectionPage extends HookConsumerWidget { | |||||||
|                     }, |                     }, | ||||||
|                   ), |                   ), | ||||||
|                 ), |                 ), | ||||||
| 
 |  | ||||||
|                 // buildSearchBar(), |  | ||||||
|               ], |               ], | ||||||
|             ), |             ), | ||||||
|           ), |           ), | ||||||
| @ -312,25 +303,25 @@ class BackupAlbumSelectionPage extends HookConsumerWidget { | |||||||
|                     color: context.themeData.colorScheme.onSurfaceSecondary, |                     color: context.themeData.colorScheme.onSurfaceSecondary, | ||||||
|                   ), |                   ), | ||||||
|                   border: OutlineInputBorder( |                   border: OutlineInputBorder( | ||||||
|                     borderRadius: BorderRadius.circular(25), |                     borderRadius: const BorderRadius.all(Radius.circular(25)), | ||||||
|                     borderSide: BorderSide( |                     borderSide: BorderSide( | ||||||
|                       color: context.colorScheme.surfaceContainerHighest, |                       color: context.colorScheme.surfaceContainerHighest, | ||||||
|                     ), |                     ), | ||||||
|                   ), |                   ), | ||||||
|                   enabledBorder: OutlineInputBorder( |                   enabledBorder: OutlineInputBorder( | ||||||
|                     borderRadius: BorderRadius.circular(25), |                     borderRadius: const BorderRadius.all(Radius.circular(25)), | ||||||
|                     borderSide: BorderSide( |                     borderSide: BorderSide( | ||||||
|                       color: context.colorScheme.surfaceContainerHighest, |                       color: context.colorScheme.surfaceContainerHighest, | ||||||
|                     ), |                     ), | ||||||
|                   ), |                   ), | ||||||
|                   disabledBorder: OutlineInputBorder( |                   disabledBorder: OutlineInputBorder( | ||||||
|                     borderRadius: BorderRadius.circular(25), |                     borderRadius: const BorderRadius.all(Radius.circular(25)), | ||||||
|                     borderSide: BorderSide( |                     borderSide: BorderSide( | ||||||
|                       color: context.colorScheme.surfaceContainerHighest, |                       color: context.colorScheme.surfaceContainerHighest, | ||||||
|                     ), |                     ), | ||||||
|                   ), |                   ), | ||||||
|                   focusedBorder: OutlineInputBorder( |                   focusedBorder: OutlineInputBorder( | ||||||
|                     borderRadius: BorderRadius.circular(25), |                     borderRadius: const BorderRadius.all(Radius.circular(25)), | ||||||
|                     borderSide: BorderSide( |                     borderSide: BorderSide( | ||||||
|                       color: context.colorScheme.primary.withAlpha(150), |                       color: context.colorScheme.primary.withAlpha(150), | ||||||
|                     ), |                     ), | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user