didChangePlatformBrightness method
Called when the platform brightness changes.
This method exposes notifications from dart:ui.PlatformDispatcher.onPlatformBrightnessChanged.
See also:
- MediaQuery.platformBrightnessOf, which provides a similar service with less boilerplate.
Implementation
@override
void didChangePlatformBrightness() {
notifier!.value = (_isDarkMode()) ? darkTheme : theme;
super.didChangePlatformBrightness();
}