Update Theme Setup (#2300)

* refactor(theme-setup-update): Move didChangePlatformBrightness lifecycle method to Root widget instead of AppState. We already have an active WidgetsBindingObserver in Root widget.

* fix(theme): Add workaround for flutter iOS didChangePlatformBrightness issue causing unneeded rebuilds.
This commit is contained in:
David Adegoke
2025-05-29 16:46:43 +03:00
committed by GitHub
parent b79fb6af1f
commit b77c22b0df
3 changed files with 15 additions and 26 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ abstract class ThemeStoreBase with Store {
}
MaterialThemeBase getThemeFromSystem() {
final systemBrightness = WidgetsBinding.instance.window.platformBrightness;
final systemBrightness = WidgetsBinding.instance.platformDispatcher.platformBrightness;
return systemBrightness == Brightness.dark ? ThemeList.darkTheme : ThemeList.lightTheme;
}
}