simplified code across the app and consolidated duplicated helpers

This commit is contained in:
2026-09-27 17:29:54 +02:00
parent 3e856d0b1c
commit ee1240f71a
155 changed files with 1772 additions and 2546 deletions
+14 -24
View File
@@ -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;