onPlatformBrightnessChanged method

  1. @protected
void onPlatformBrightnessChanged()

Implementation

@protected
void onPlatformBrightnessChanged() {
  final newBrightness =
      WidgetsBinding.instance.platformDispatcher.platformBrightness;
  final brightness = currentState.brightness;
  final themeMode = currentState.themeMode;

  if (themeMode == ThemeMode.system && newBrightness != brightness) {
    addEvent(const FastThemeBlocEvent.system());
  }
}