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() {
final brightness = WidgetsBinding.instance.window.platformBrightness;
_controller.add(TThemeModes.fromBrightness(brightness));
}