@ -2,6 +2,7 @@ import 'package:dynamic_color/dynamic_color.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/constants/immich_colors.dart ' ;
import ' package:immich_mobile/constants/immich_colors.dart ' ;
import ' package:immich_mobile/constants/locales.dart ' ;
import ' package:immich_mobile/extensions/theme_extensions.dart ' ;
import ' package:immich_mobile/extensions/theme_extensions.dart ' ;
import ' package:immich_mobile/providers/app_settings.provider.dart ' ;
import ' package:immich_mobile/providers/app_settings.provider.dart ' ;
import ' package:immich_mobile/services/app_settings.service.dart ' ;
import ' package:immich_mobile/services/app_settings.service.dart ' ;
@ -145,7 +146,18 @@ ImmichTheme _decolorizeSurfaces({
) ;
) ;
}
}
ThemeData getThemeData ( { required ColorScheme colorScheme } ) {
String ? getFontFamilyFromLocale ( Locale locale ) {
if ( localesNotSupportedByOverpass . contains ( locale ) ) {
/ / Let Flutter use the default font
return null ;
}
return ' Overpass ' ;
}
ThemeData getThemeData ( {
required ColorScheme colorScheme ,
required Locale locale ,
} ) {
var isDark = colorScheme . brightness = = Brightness . dark ;
var isDark = colorScheme . brightness = = Brightness . dark ;
var primaryColor = colorScheme . primary ;
var primaryColor = colorScheme . primary ;
@ -163,10 +175,10 @@ ThemeData getThemeData({required ColorScheme colorScheme}) {
bottomSheetTheme: BottomSheetThemeData (
bottomSheetTheme: BottomSheetThemeData (
backgroundColor: colorScheme . surfaceContainer ,
backgroundColor: colorScheme . surfaceContainer ,
) ,
) ,
fontFamily: ' Overpass ' ,
fontFamily: getFontFamilyFromLocale ( locale ) ,
snackBarTheme: SnackBarThemeData (
snackBarTheme: SnackBarThemeData (
contentTextStyle: TextStyle (
contentTextStyle: TextStyle (
fontFamily: ' Overpass ' ,
fontFamily: getFontFamilyFromLocale ( locale ) ,
color: primaryColor ,
color: primaryColor ,
fontWeight: FontWeight . bold ,
fontWeight: FontWeight . bold ,
) ,
) ,
@ -175,7 +187,7 @@ ThemeData getThemeData({required ColorScheme colorScheme}) {
appBarTheme: AppBarTheme (
appBarTheme: AppBarTheme (
titleTextStyle: TextStyle (
titleTextStyle: TextStyle (
color: primaryColor ,
color: primaryColor ,
fontFamily: ' Overpass ' ,
fontFamily: getFontFamilyFromLocale ( locale ) ,
fontWeight: FontWeight . bold ,
fontWeight: FontWeight . bold ,
fontSize: 18 ,
fontSize: 18 ,
) ,
) ,