readInitialLifecycleStateFromNativeWindow method

  1. @protected
void readInitialLifecycleStateFromNativeWindow ()

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.


void readInitialLifecycleStateFromNativeWindow() {
  if (lifecycleState != null) {
  final AppLifecycleState state = _parseAppLifecycleMessage(window.initialLifecycleState);
  if (state != null) {