12 lines
298 B
Dart
Executable File
12 lines
298 B
Dart
Executable File
enum AppTheme { light, dark, system }
|
|
|
|
extension AppThemeExtension on AppTheme {
|
|
String get name => toString().split('.').last;
|
|
|
|
static AppTheme fromString(String value) {
|
|
return AppTheme.values.firstWhere(
|
|
(e) => e.name == value,
|
|
orElse: () => AppTheme.system,
|
|
);
|
|
}
|
|
} |