Client/lib/theming/appTheme.dart

28 lines
766 B
Dart

import 'package:flutter/material.dart';
class AppTheme {
static ThemeModeDisplay getDisplayOptions(ThemeMode theme) {
switch(theme) {
case ThemeMode.system:
return ThemeModeDisplay(icon: Icons.auto_fix_high_outlined, displayName: "Systemvorgabe");
case ThemeMode.light:
return ThemeModeDisplay(icon: Icons.dark_mode_outlined, displayName: "Hell");
case ThemeMode.dark:
return ThemeModeDisplay(icon: Icons.dark_mode, displayName: "Dunkel");
}
}
static bool isDarkMode(BuildContext context) {
return Theme.of(context).brightness == Brightness.dark;
}
}
class ThemeModeDisplay {
final IconData icon;
final String displayName;
ThemeModeDisplay({required this.icon, required this.displayName});
}