handleAppLifecycleStateChanged method

  1. @protected
  2. @mustCallSuper
void handleAppLifecycleStateChanged (AppLifecycleState state)
@mustCallSuper, @protected

Called when the application lifecycle state changes.

Notifies all the observers using WidgetsBindingObserver.didChangeAppLifecycleState.

This method exposes notifications from SystemChannels.lifecycle.

Implementation

@protected
@mustCallSuper
void handleAppLifecycleStateChanged(AppLifecycleState state) {
  assert(state != null);
  _lifecycleState = state;
  switch (state) {
    case AppLifecycleState.resumed:
    case AppLifecycleState.inactive:
      _setFramesEnabledState(true);
      break;
    case AppLifecycleState.paused:
    case AppLifecycleState.suspending:
      _setFramesEnabledState(false);
      break;
  }
}