File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,24 @@ class _AppState extends State<App> {
5656 //TODO: wait until settings is ready?
5757 settings.onChange ().listen ((_) {
5858 setState (() {
59- if (! settings.useSystemColors) {
59+ if (settings.useSystemColors) {
60+ brightness = SchedulerBinding .instance.platformDispatcher.platformBrightness;
61+ } else {
6062 brightness = settings.darkMode ? Brightness .dark : Brightness .light;
6163 }
6264 });
6365 });
6466
67+ // Listen to changes to the system brightness mode, update accordingly
68+ final dispatcher = SchedulerBinding .instance.platformDispatcher;
69+ dispatcher.onPlatformBrightnessChanged = () {
70+ if (settings.useSystemColors) {
71+ setState (() {
72+ brightness = dispatcher.platformBrightness;
73+ });
74+ }
75+ };
76+
6577 super .initState ();
6678 }
6779
You can’t perform that action at this time.
0 commit comments