mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:27:09 -05:00 
			
		
		
		
	* feat(mobile): add support for material themes Added support for custom theming and updated all elements accordingly. * fix(mobile): Restored immich brand colors to default theme * fix(mobile): make ListTile titles bold in settings main page * feat(mobile): update bottom nav and appbar colors * small tweaks --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
		
			
				
	
	
		
			75 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			75 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'package:flutter/material.dart';
 | 
						|
import 'package:immich_mobile/extensions/build_context_extensions.dart';
 | 
						|
import 'package:immich_mobile/extensions/theme_extensions.dart';
 | 
						|
 | 
						|
class ThumbnailWithInfoContainer extends StatelessWidget {
 | 
						|
  const ThumbnailWithInfoContainer({
 | 
						|
    super.key,
 | 
						|
    this.onTap,
 | 
						|
    this.borderRadius = 10,
 | 
						|
    required this.label,
 | 
						|
    required this.child,
 | 
						|
  });
 | 
						|
 | 
						|
  final VoidCallback? onTap;
 | 
						|
  final double borderRadius;
 | 
						|
  final String label;
 | 
						|
  final Widget child;
 | 
						|
 | 
						|
  @override
 | 
						|
  Widget build(BuildContext context) {
 | 
						|
    return GestureDetector(
 | 
						|
      onTap: onTap,
 | 
						|
      child: Stack(
 | 
						|
        alignment: Alignment.bottomLeft,
 | 
						|
        children: [
 | 
						|
          Container(
 | 
						|
            decoration: BoxDecoration(
 | 
						|
              borderRadius: BorderRadius.circular(borderRadius),
 | 
						|
              gradient: LinearGradient(
 | 
						|
                colors: [
 | 
						|
                  context.colorScheme.surfaceContainer,
 | 
						|
                  context.colorScheme.surfaceContainer.darken(amount: .1),
 | 
						|
                ],
 | 
						|
                begin: Alignment.topCenter,
 | 
						|
                end: Alignment.bottomCenter,
 | 
						|
              ),
 | 
						|
            ),
 | 
						|
            foregroundDecoration: BoxDecoration(
 | 
						|
              borderRadius: BorderRadius.circular(borderRadius),
 | 
						|
              color: Colors.white,
 | 
						|
              gradient: LinearGradient(
 | 
						|
                begin: FractionalOffset.topCenter,
 | 
						|
                end: FractionalOffset.bottomCenter,
 | 
						|
                colors: [
 | 
						|
                  Colors.transparent,
 | 
						|
                  label == ''
 | 
						|
                      ? Colors.black.withOpacity(0.1)
 | 
						|
                      : Colors.black.withOpacity(0.5),
 | 
						|
                ],
 | 
						|
                stops: const [0.0, 1.0],
 | 
						|
              ),
 | 
						|
            ),
 | 
						|
            child: child,
 | 
						|
          ),
 | 
						|
          Padding(
 | 
						|
            padding: const EdgeInsets.symmetric(horizontal: 8) +
 | 
						|
                const EdgeInsets.only(bottom: 8),
 | 
						|
            child: Text(
 | 
						|
              label,
 | 
						|
              style: const TextStyle(
 | 
						|
                color: Colors.white,
 | 
						|
                fontWeight: FontWeight.bold,
 | 
						|
                fontSize: 14,
 | 
						|
              ),
 | 
						|
              maxLines: 2,
 | 
						|
              softWrap: false,
 | 
						|
              overflow: TextOverflow.ellipsis,
 | 
						|
            ),
 | 
						|
          ),
 | 
						|
        ],
 | 
						|
      ),
 | 
						|
    );
 | 
						|
  }
 | 
						|
}
 |