mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-31 02:39:03 -04:00 
			
		
		
		
	* Refactors to use widgets in immich asset grid Adds comments * Fixes asset thumbnail absoluteOffset * feat(mobile): Uses gradient image placeholders in memory lane and in the asset grid (#7142) * Uses gradient image placeholders in memory lane and in the asset grid * Changes to create placeholders in immmich image.thumbnail * removed unused import * uses context.isDarkTheme and fixed function signature for allAssetsSelected
		
			
				
	
	
		
			42 lines
		
	
	
		
			924 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			924 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'package:flutter/material.dart';
 | |
| import 'package:immich_mobile/extensions/build_context_extensions.dart';
 | |
| 
 | |
| class ThumbnailPlaceholder extends StatelessWidget {
 | |
|   final EdgeInsets margin;
 | |
|   final double width;
 | |
|   final double height;
 | |
| 
 | |
|   const ThumbnailPlaceholder({
 | |
|     super.key,
 | |
|     this.margin = EdgeInsets.zero,
 | |
|     this.width = 250,
 | |
|     this.height = 250,
 | |
|   });
 | |
| 
 | |
|   static const _brightColors = [
 | |
|     Color(0xFFF1F3F4),
 | |
|     Color(0xFFB4B6B8),
 | |
|   ];
 | |
| 
 | |
|   static const _darkColors = [
 | |
|     Color(0xFF3B3F42),
 | |
|     Color(0xFF2B2F32),
 | |
|   ];
 | |
| 
 | |
|   @override
 | |
|   Widget build(BuildContext context) {
 | |
|     return Container(
 | |
|       width: width,
 | |
|       height: height,
 | |
|       margin: margin,
 | |
|       decoration: BoxDecoration(
 | |
|         gradient: LinearGradient(
 | |
|           colors: context.isDarkTheme ? _darkColors : _brightColors,
 | |
|           begin: Alignment.topCenter,
 | |
|           end: Alignment.bottomCenter,
 | |
|         ),
 | |
|       ),
 | |
|     );
 | |
|   }
 | |
| }
 |