Google is committed to advancing racial equity for Black communities. See how.

enableLifecycleEvents method

*[<Null safety>](https://dart.dev/null-safety)*

void enableLifecycleEvents (Outgoing outgoing)

Initializes the shared Lifecycle instance. This is required before Lifecycle can be constructed.

Implementation

static void enableLifecycleEvents(Outgoing outgoing) {
  if (_singleton == null) {
    _singleton = LifecycleImpl(
      outgoing: outgoing,
      exitHandler: fuchsia.exit,
    );
  } else {
    throw Exception(
        'Attempted to call Lifecycle.enableLifecycleEvents after it has already been enabled. '
        'Ensure that Lifecycle.enableLifecycleEvents is not called multiple times.');
  }
}