getThemeMode method
User-selected theme. Defaults to ThemeMode.system when unset or when
the stored value isn't a recognised ThemeMode.name (e.g. corruption).
Implementation
Future<ThemeMode> getThemeMode() async {
final p = await _prefs();
final raw = p.getString(_themeModeKey);
if (raw == null) return ThemeMode.system;
try {
return ThemeMode.values.byName(raw);
} on ArgumentError {
return ThemeMode.system;
}
}