Skip to content

Commit

Permalink
Reference AppLifecycleListener from widgets library (#132995)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hixie authored Aug 23, 2023
1 parent 487bd69 commit 8829098
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/flutter/lib/src/widgets/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions packages/flutter/lib/src/widgets/framework.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down

0 comments on commit 8829098

Please sign in to comment.