feat(settings - appearance): add system option (#1279)

Closes #1260
This commit is contained in:
Benjamin
2023-09-20 17:25:23 -07:00
committed by GitHub
parent e75d3c8273
commit 6260a80738
5 changed files with 165 additions and 49 deletions

View File

@ -30,11 +30,8 @@ class NavigationViewModel extends IndexTrackingViewModel {
);
}
if (prefs.getBool('useDarkTheme') == null) {
final bool isDark =
MediaQuery.platformBrightnessOf(context) != Brightness.light;
await prefs.setBool('useDarkTheme', isDark);
await DynamicTheme.of(context)!.setTheme(isDark ? 1 : 0);
if (prefs.getInt('themeMode') == null) {
await prefs.setInt('themeMode', 0);
}
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
SystemChrome.setSystemUIOverlayStyle(