Add docs to Route.maintainState (#130638)

Fixes https://github.com/flutter/flutter/issues/44836
This commit is contained in:
Ian Hickson
2023-07-19 15:53:54 -07:00
committed by GitHub
parent 910e87eb73
commit 10f464895d

View File

@@ -1432,11 +1432,20 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
/// pops. If this is not necessary, this can be set to false to allow the
/// framework to entirely discard the route's widget hierarchy when it is not
/// visible.
///
/// Setting [maintainState] to false does not guarantee that the route will be
/// discarded. For instance, it will not be descarded if it is still visible
/// because the next above it is not opaque (e.g. it is a popup dialog).
/// {@endtemplate}
///
/// If this getter would ever start returning a different value, the
/// [changedInternalState] should be invoked so that the change can take
/// effect.
///
/// See also:
///
/// * [OverlayEntry.maintainState], which is the underlying implementation
/// of this property.
bool get maintainState;