readInitialLifecycleStateFromNativeWindow method

  1. @protected
void readInitialLifecycleStateFromNativeWindow ()
@protected

Initializes the lifecycleState with the initialLifecycleState from the window.

Once the lifecycleState is populated through any means (including this method), this method will do nothing. This is because the initialLifecycleState may already be stale and it no longer makes sense to use the initial state at dart vm startup as the current state anymore.

The latest state should be obtained by subscribing to WidgetsBindingObserver.didChangeAppLifecycleState.

Implementation

@protected
void readInitialLifecycleStateFromNativeWindow() {
  if (_lifecycleState == null && _parseAppLifecycleMessage(window.initialLifecycleState) != null) {
    _handleLifecycleMessage(window.initialLifecycleState);
  }
}