simplified code across the app and consolidated duplicated helpers
This commit is contained in:
+14
-24
@@ -10,31 +10,21 @@ class AppSpacing {
|
||||
static const double xl = 40;
|
||||
}
|
||||
|
||||
TextStyle inputErrorStyle(BuildContext context) =>
|
||||
TextStyle(color: Theme.of(context).colorScheme.error);
|
||||
|
||||
class AppTheme {
|
||||
static DropdownDisplay getDisplayOptions(ThemeMode theme) {
|
||||
switch (theme) {
|
||||
case ThemeMode.system:
|
||||
return DropdownDisplay(
|
||||
icon: Icons.auto_fix_high_outlined,
|
||||
displayName: 'Systemvorgabe',
|
||||
);
|
||||
|
||||
case ThemeMode.light:
|
||||
return DropdownDisplay(
|
||||
icon: Icons.wb_sunny_outlined,
|
||||
displayName: 'Hell',
|
||||
);
|
||||
|
||||
case ThemeMode.dark:
|
||||
return DropdownDisplay(
|
||||
icon: Icons.dark_mode_outlined,
|
||||
displayName: 'Dunkel',
|
||||
);
|
||||
}
|
||||
}
|
||||
static DropdownDisplay getDisplayOptions(ThemeMode theme) => switch (theme) {
|
||||
ThemeMode.system => DropdownDisplay(
|
||||
icon: Icons.auto_fix_high_outlined,
|
||||
displayName: 'Systemvorgabe',
|
||||
),
|
||||
ThemeMode.light => DropdownDisplay(
|
||||
icon: Icons.wb_sunny_outlined,
|
||||
displayName: 'Hell',
|
||||
),
|
||||
ThemeMode.dark => DropdownDisplay(
|
||||
icon: Icons.dark_mode_outlined,
|
||||
displayName: 'Dunkel',
|
||||
),
|
||||
};
|
||||
|
||||
static bool isDarkMode(BuildContext context) =>
|
||||
Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
Reference in New Issue
Block a user