handleAppLifecycleStateChanged method

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

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) {
  if (lifecycleState == state) {
    return;
  }
  _lifecycleState = state;
  switch (state) {
    case AppLifecycleState.resumed:
    case AppLifecycleState.inactive:
      _setFramesEnabledState(true);
    case AppLifecycleState.hidden:
    case AppLifecycleState.paused:
    case AppLifecycleState.detached:
      _setFramesEnabledState(false);
  }
}