Skip to content

AppLifecycleProbe

Collects an AppLifecycleEvent each time the app lifecycle state changes.

Observes WidgetsBinding while resumed.

Inheritance
Mixed-in types

Constructors

AppLifecycleProbe

AppLifecycleProbe()

Properties

stream

Stream<Measurement> get stream
override

The stream of Measurements to forward. Implemented by subclasses.

Read on the first resume after creation or a pause.

Methods

didChangeAppLifecycleState

void didChangeAppLifecycleState(
  1. AppLifecycleState state
)
override

Called when the system puts the app in the background or returns the app to the foreground.

An example of implementing this method is provided in the class-level documentation for the WidgetsBindingObserver class.

This method exposes notifications from SystemChannels.lifecycle.

See also:

onPause

Future<bool> onPause()
override

Called by pause. Returns true if successfully paused.

If false, the state is not changed.

onResume

Future<bool> onResume()
override

Called by resume. Returns true if successfully resumed.

If false, the executor moves to ExecutorState.PausedButShouldBeResumed.