AppLifecycleProbe
Collects an AppLifecycleEvent each time the app lifecycle state changes.
Observes WidgetsBinding while resumed.
- Inheritance
-
- Object
- AbstractExecutor<
Measure> - Probe
- StreamProbe
- AppLifecycleProbe
- Mixed-in types
Constructors
AppLifecycleProbe
Properties
stream
override
The stream of Measurements to forward. Implemented by subclasses.
Read on the first resume after creation or a pause.
Methods
didChangeAppLifecycleState
- 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:
- AppLifecycleListener, an alternative API for responding to application lifecycle changes.
onPause
Called by pause. Returns true if successfully paused.
If false, the state is not changed.
onResume
Called by resume. Returns true if successfully resumed.
If false, the executor moves to ExecutorState.PausedButShouldBeResumed.