didChangePlatformBrightness method

  1. @protected
  2. @override
  3. @mustCallSuper
void didChangePlatformBrightness()
inherited

Called when the platform brightness changes.

Implementation

@protected
@override
@mustCallSuper
void didChangePlatformBrightness() {
  /// No 'setState()' functions are allowed to fully function at this point.
  _rebuildAllowed = false;
  for (final listener in _beforeList) {
    listener.didChangePlatformBrightness();
  }
  for (final con in _controllerList) {
    con.didChangePlatformBrightness();
  }
  for (final listener in _afterList) {
    listener.didChangePlatformBrightness();
  }
  _rebuildAllowed = true;
  if (_rebuildRequested || _inTester) {
    _rebuildRequested = false;

    /// Perform a 'rebuild' if requested.
    refresh();
  }
}