Reference AppLifecycleListener from widgets library (#132995)

This commit is contained in:
Ian Hickson 2023-08-22 21:13:15 -07:00 committed by GitHub
parent 487bd69078
commit 88290989a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -254,6 +254,11 @@ abstract mixin class WidgetsBindingObserver {
/// documentation for the [WidgetsBindingObserver] class.
///
/// This method exposes notifications from [SystemChannels.lifecycle].
///
/// See also:
///
/// * [AppLifecycleListener], an alternative API for responding to
/// application lifecycle changes.
void didChangeAppLifecycleState(AppLifecycleState state) { }
/// Called when a request is received from the system to exit the application.
@ -1171,6 +1176,9 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB
/// To artificially cause the entire widget tree to be disposed, consider
/// calling [runApp] with a widget such as [SizedBox.shrink].
///
/// To listen for platform shutdown messages (and other lifecycle changes),
/// consider the [AppLifecycleListener] API.
///
/// See also:
///
/// * [WidgetsBinding.attachRootWidget], which creates the root widget for the

View File

@ -1317,6 +1317,9 @@ abstract class State<T extends StatefulWidget> with Diagnosticable {
/// To artificially cause the entire widget tree to be disposed, consider
/// calling [runApp] with a widget such as [SizedBox.shrink].
///
/// To listen for platform shutdown messages (and other lifecycle changes),
/// consider the [AppLifecycleListener] API.
///
/// See also:
///
/// * [deactivate], which is called prior to [dispose].