refactor: migrate MediaQuery properties to InheritedModel (#1115)

Co-authored-by: Ushie <ushiekane@gmail.com>
This commit is contained in:
Dhruvan Bhalara
2023-08-10 17:55:07 +05:30
committed by GitHub
parent f5e45ead26
commit 97e37f304b
7 changed files with 9 additions and 8 deletions

View File

@ -33,7 +33,7 @@ class NavigationViewModel extends IndexTrackingViewModel {
if (prefs.getBool('useDarkTheme') == null) {
final bool isDark =
MediaQuery.of(context).platformBrightness != Brightness.light;
MediaQuery.platformBrightnessOf(context) != Brightness.light;
await prefs.setBool('useDarkTheme', isDark);
await DynamicTheme.of(context)!.setTheme(isDark ? 1 : 0);
}