Skip to content

Commit 8829098

Browse files
authored
Reference AppLifecycleListener from widgets library (flutter#132995)
1 parent 487bd69 commit 8829098

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/flutter/lib/src/widgets/binding.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ abstract mixin class WidgetsBindingObserver {
254254
/// documentation for the [WidgetsBindingObserver] class.
255255
///
256256
/// This method exposes notifications from [SystemChannels.lifecycle].
257+
///
258+
/// See also:
259+
///
260+
/// * [AppLifecycleListener], an alternative API for responding to
261+
/// application lifecycle changes.
257262
void didChangeAppLifecycleState(AppLifecycleState state) { }
258263

259264
/// Called when a request is received from the system to exit the application.
@@ -1171,6 +1176,9 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB
11711176
/// To artificially cause the entire widget tree to be disposed, consider
11721177
/// calling [runApp] with a widget such as [SizedBox.shrink].
11731178
///
1179+
/// To listen for platform shutdown messages (and other lifecycle changes),
1180+
/// consider the [AppLifecycleListener] API.
1181+
///
11741182
/// See also:
11751183
///
11761184
/// * [WidgetsBinding.attachRootWidget], which creates the root widget for the

packages/flutter/lib/src/widgets/framework.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,9 @@ abstract class State<T extends StatefulWidget> with Diagnosticable {
13171317
/// To artificially cause the entire widget tree to be disposed, consider
13181318
/// calling [runApp] with a widget such as [SizedBox.shrink].
13191319
///
1320+
/// To listen for platform shutdown messages (and other lifecycle changes),
1321+
/// consider the [AppLifecycleListener] API.
1322+
///
13201323
/// See also:
13211324
///
13221325
/// * [deactivate], which is called prior to [dispose].

0 commit comments

Comments
 (0)