2026-04-05 10:06:26 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
enum AppThemeMode {
|
2026-04-06 08:48:10 +02:00
|
|
|
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
|
|
|
|
2026-04-06 08:48:10 +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;
|
2026-04-06 08:48:10 +02:00
|
|
|
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;
|
|
|
|
|
}
|