loadThemeMode static method
Implementation
static Future<ThemeMode> loadThemeMode() async {
final prefs = await SharedPreferences.getInstance();
final theme = prefs.getString(_themeKey) ?? 'system'; // Default to system if no value exists
switch (theme) {
case 'light':
return ThemeMode.light;
case 'dark':
return ThemeMode.dark;
case 'system':
default:
return ThemeMode.system;
}
}