Files
flux/lib/data/enums.dart

29 lines
729 B
Dart
Raw Normal View History

2026-04-05 10:06:26 +02:00
import 'package:flutter/material.dart';
enum AppThemeMode {
light('light', 'Chiaro', ThemeMode.light, Icons.light_mode),
dark('dark', 'Scuro', ThemeMode.dark, Icons.dark_mode),
system('system', 'Sistema', ThemeMode.system, Icons.brightness_auto);
2026-04-05 10:06:26 +02:00
const AppThemeMode(this.value, this.label, this.themeMode, this.icon);
2026-04-05 10:06:26 +02:00
final String value;
final String label;
final ThemeMode themeMode;
final IconData icon;
static AppThemeMode fromValue(String? value) {
return AppThemeMode.values.firstWhere(
(e) => e.value == value,
orElse: () => AppThemeMode.system,
);
}
2026-04-05 10:06:26 +02:00
}
2026-04-06 10:55:56 +02:00
enum PrefKeys {
theme('themeModeSetting'),
lastStore('lastStore');
const PrefKeys(this.value);
final String value;
}