mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore: bump dart sdk to 3.8 (#20355)
* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
9b3718120b
commit
e52b9d15b5
643 changed files with 32561 additions and 35292 deletions
|
|
@ -6,10 +6,7 @@ final Map<ImmichColorPreset, ImmichTheme> _themePresets = {
|
|||
ImmichColorPreset.indigo: ImmichTheme(
|
||||
light: ColorScheme.fromSeed(
|
||||
seedColor: immichBrandColorLight,
|
||||
).copyWith(
|
||||
primary: immichBrandColorLight,
|
||||
onSurface: const Color.fromARGB(255, 34, 31, 32),
|
||||
),
|
||||
).copyWith(primary: immichBrandColorLight, onSurface: const Color.fromARGB(255, 34, 31, 32)),
|
||||
dark: ColorScheme.fromSeed(
|
||||
seedColor: immichBrandColorDark,
|
||||
brightness: Brightness.dark,
|
||||
|
|
@ -17,24 +14,15 @@ final Map<ImmichColorPreset, ImmichTheme> _themePresets = {
|
|||
),
|
||||
ImmichColorPreset.deepPurple: ImmichTheme(
|
||||
light: ColorScheme.fromSeed(seedColor: const Color(0xFF6F43C0)),
|
||||
dark: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFFD3BBFF),
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
dark: ColorScheme.fromSeed(seedColor: const Color(0xFFD3BBFF), brightness: Brightness.dark),
|
||||
),
|
||||
ImmichColorPreset.pink: ImmichTheme(
|
||||
light: ColorScheme.fromSeed(seedColor: const Color(0xFFED79B5)),
|
||||
dark: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFFED79B5),
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
dark: ColorScheme.fromSeed(seedColor: const Color(0xFFED79B5), brightness: Brightness.dark),
|
||||
),
|
||||
ImmichColorPreset.red: ImmichTheme(
|
||||
light: ColorScheme.fromSeed(seedColor: const Color(0xFFC51C16)),
|
||||
dark: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFFD3302F),
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
dark: ColorScheme.fromSeed(seedColor: const Color(0xFFD3302F), brightness: Brightness.dark),
|
||||
),
|
||||
ImmichColorPreset.orange: ImmichTheme(
|
||||
light: ColorScheme.fromSeed(
|
||||
|
|
@ -49,37 +37,22 @@ final Map<ImmichColorPreset, ImmichTheme> _themePresets = {
|
|||
),
|
||||
ImmichColorPreset.yellow: ImmichTheme(
|
||||
light: ColorScheme.fromSeed(seedColor: const Color(0xFFFFB400)),
|
||||
dark: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFFFFB400),
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
dark: ColorScheme.fromSeed(seedColor: const Color(0xFFFFB400), brightness: Brightness.dark),
|
||||
),
|
||||
ImmichColorPreset.lime: ImmichTheme(
|
||||
light: ColorScheme.fromSeed(seedColor: const Color(0xFFCDDC39)),
|
||||
dark: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFFCDDC39),
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
dark: ColorScheme.fromSeed(seedColor: const Color(0xFFCDDC39), brightness: Brightness.dark),
|
||||
),
|
||||
ImmichColorPreset.green: ImmichTheme(
|
||||
light: ColorScheme.fromSeed(seedColor: const Color(0xFF18C249)),
|
||||
dark: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFF18C249),
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
dark: ColorScheme.fromSeed(seedColor: const Color(0xFF18C249), brightness: Brightness.dark),
|
||||
),
|
||||
ImmichColorPreset.cyan: ImmichTheme(
|
||||
light: ColorScheme.fromSeed(seedColor: const Color(0xFF00BCD4)),
|
||||
dark: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFF00BCD4),
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
dark: ColorScheme.fromSeed(seedColor: const Color(0xFF00BCD4), brightness: Brightness.dark),
|
||||
),
|
||||
ImmichColorPreset.slateGray: ImmichTheme(
|
||||
light: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFF696969),
|
||||
dynamicSchemeVariant: DynamicSchemeVariant.neutral,
|
||||
),
|
||||
light: ColorScheme.fromSeed(seedColor: const Color(0xFF696969), dynamicSchemeVariant: DynamicSchemeVariant.neutral),
|
||||
dark: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xff696969),
|
||||
brightness: Brightness.dark,
|
||||
|
|
|
|||
|
|
@ -18,14 +18,8 @@ abstract final class DynamicTheme {
|
|||
// Some palettes do not generate surface container colors accurately,
|
||||
// so we regenerate all colors using the primary color
|
||||
_theme = ImmichTheme(
|
||||
light: ColorScheme.fromSeed(
|
||||
seedColor: primaryColor,
|
||||
brightness: Brightness.light,
|
||||
),
|
||||
dark: ColorScheme.fromSeed(
|
||||
seedColor: primaryColor,
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
light: ColorScheme.fromSeed(seedColor: primaryColor, brightness: Brightness.light),
|
||||
dark: ColorScheme.fromSeed(seedColor: primaryColor, brightness: Brightness.dark),
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -10,10 +10,7 @@ class ImmichTheme {
|
|||
const ImmichTheme({required this.light, required this.dark});
|
||||
}
|
||||
|
||||
ThemeData getThemeData({
|
||||
required ColorScheme colorScheme,
|
||||
required Locale locale,
|
||||
}) {
|
||||
ThemeData getThemeData({required ColorScheme colorScheme, required Locale locale}) {
|
||||
final isDark = colorScheme.brightness == Brightness.dark;
|
||||
|
||||
return ThemeData(
|
||||
|
|
@ -26,9 +23,7 @@ ThemeData getThemeData({
|
|||
scaffoldBackgroundColor: colorScheme.surface,
|
||||
splashColor: colorScheme.primary.withValues(alpha: 0.1),
|
||||
highlightColor: colorScheme.primary.withValues(alpha: 0.1),
|
||||
bottomSheetTheme: BottomSheetThemeData(
|
||||
backgroundColor: colorScheme.surfaceContainer,
|
||||
),
|
||||
bottomSheetTheme: BottomSheetThemeData(backgroundColor: colorScheme.surfaceContainer),
|
||||
fontFamily: _getFontFamilyFromLocale(locale),
|
||||
snackBarTheme: SnackBarThemeData(
|
||||
contentTextStyle: TextStyle(
|
||||
|
|
@ -52,30 +47,12 @@ ThemeData getThemeData({
|
|||
centerTitle: true,
|
||||
),
|
||||
textTheme: const TextTheme(
|
||||
displayLarge: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
displayMedium: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
displaySmall: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
titleSmall: TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
titleMedium: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
titleLarge: TextStyle(
|
||||
fontSize: 26.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
displayLarge: TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
|
||||
displayMedium: TextStyle(fontSize: 14, fontWeight: FontWeight.w600),
|
||||
displaySmall: TextStyle(fontSize: 12, fontWeight: FontWeight.w600),
|
||||
titleSmall: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600),
|
||||
titleMedium: TextStyle(fontSize: 18.0, fontWeight: FontWeight.w600),
|
||||
titleLarge: TextStyle(fontSize: 26.0, fontWeight: FontWeight.w600),
|
||||
),
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
|
@ -83,81 +60,43 @@ ThemeData getThemeData({
|
|||
foregroundColor: isDark ? Colors.black87 : Colors.white,
|
||||
),
|
||||
),
|
||||
chipTheme: const ChipThemeData(
|
||||
side: BorderSide.none,
|
||||
),
|
||||
sliderTheme: const SliderThemeData(
|
||||
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 7),
|
||||
trackHeight: 2.0,
|
||||
),
|
||||
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
|
||||
type: BottomNavigationBarType.fixed,
|
||||
),
|
||||
chipTheme: const ChipThemeData(side: BorderSide.none),
|
||||
sliderTheme: const SliderThemeData(thumbShape: RoundSliderThumbShape(enabledThumbRadius: 7), trackHeight: 2.0),
|
||||
bottomNavigationBarTheme: const BottomNavigationBarThemeData(type: BottomNavigationBarType.fixed),
|
||||
popupMenuTheme: const PopupMenuThemeData(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10))),
|
||||
),
|
||||
navigationBarTheme: NavigationBarThemeData(
|
||||
backgroundColor: isDark ? colorScheme.surfaceContainer : colorScheme.surface,
|
||||
labelTextStyle: const WidgetStatePropertyAll(
|
||||
TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
labelTextStyle: const WidgetStatePropertyAll(TextStyle(fontSize: 14, fontWeight: FontWeight.w500)),
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: colorScheme.primary,
|
||||
),
|
||||
borderSide: BorderSide(color: colorScheme.primary),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(15)),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: colorScheme.outlineVariant,
|
||||
),
|
||||
borderSide: BorderSide(color: colorScheme.outlineVariant),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(15)),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
color: colorScheme.primary,
|
||||
),
|
||||
hintStyle: const TextStyle(
|
||||
fontSize: 14.0,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
),
|
||||
textSelectionTheme: TextSelectionThemeData(
|
||||
cursorColor: colorScheme.primary,
|
||||
labelStyle: TextStyle(color: colorScheme.primary),
|
||||
hintStyle: const TextStyle(fontSize: 14.0, fontWeight: FontWeight.normal),
|
||||
),
|
||||
textSelectionTheme: TextSelectionThemeData(cursorColor: colorScheme.primary),
|
||||
dropdownMenuTheme: DropdownMenuThemeData(
|
||||
menuStyle: const MenuStyle(
|
||||
shape: WidgetStatePropertyAll<OutlinedBorder>(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(15)),
|
||||
),
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15))),
|
||||
),
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: colorScheme.primary,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: colorScheme.primary)),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: colorScheme.outlineVariant,
|
||||
),
|
||||
borderSide: BorderSide(color: colorScheme.outlineVariant),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(15)),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
color: colorScheme.primary,
|
||||
),
|
||||
hintStyle: const TextStyle(
|
||||
fontSize: 14.0,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
labelStyle: TextStyle(color: colorScheme.primary),
|
||||
hintStyle: const TextStyle(fontSize: 14.0, fontWeight: FontWeight.normal),
|
||||
),
|
||||
),
|
||||
dialogTheme: DialogThemeData(backgroundColor: colorScheme.surfaceContainer),
|
||||
|
|
@ -174,9 +113,7 @@ ThemeData getThemeData({
|
|||
// This method replaces all surface shades in ImmichTheme to a static ones
|
||||
// as we are creating the colorscheme through seedColor the default surfaces are
|
||||
// tinted with primary color
|
||||
ImmichTheme decolorizeSurfaces({
|
||||
required ImmichTheme theme,
|
||||
}) {
|
||||
ImmichTheme decolorizeSurfaces({required ImmichTheme theme}) {
|
||||
return ImmichTheme(
|
||||
light: theme.light.copyWith(
|
||||
surface: const Color(0xFFf9f9f9),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue