mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 13:19:44 +02:00
feat(appearance): add an optional system font
This commit is contained in:
1 parent
c89601b6dc
commit
9322e54739
12 files changed
+179
-23
No files matched your search
@@ -15,6 +15,7 @@ ThemeSettings loadBootstrapThemeSettings(SharedPreferences prefs) {
|
||||
useAmoled: prefs.getBool(kUseAmoledKey) ?? false,
|
||||
style: themeStyleFromString(prefs.getString(kThemeStyleKey)),
|
||||
mornyeAccent: mornyeAccentFromString(prefs.getString(kMornyeAccentKey)),
|
||||
useSystemFont: prefs.getBool(kUseSystemFontKey) ?? false,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -49,6 +50,7 @@ class ThemeNotifier extends Notifier<ThemeSettings> {
|
||||
await prefs.setBool(kUseAmoledKey, state.useAmoled);
|
||||
await prefs.setString(kThemeStyleKey, state.style.name);
|
||||
await prefs.setString(kMornyeAccentKey, state.mornyeAccent.name);
|
||||
await prefs.setBool(kUseSystemFontKey, state.useSystemFont);
|
||||
} catch (e) {
|
||||
debugPrint('Error saving theme settings: $e');
|
||||
}
|
||||
@@ -88,4 +90,9 @@ class ThemeNotifier extends Notifier<ThemeSettings> {
|
||||
state = state.copyWith(mornyeAccent: accent);
|
||||
await _saveToStorage();
|
||||
}
|
||||
|
||||
Future<void> setUseSystemFont(bool value) async {
|
||||
state = state.copyWith(useSystemFont: value);
|
||||
await _saveToStorage();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user