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() {
if (_isDisposed) return;
final brightness =
WidgetsBinding.instance.platformDispatcher.platformBrightness;
_updateSystemBrightness(brightness);
}