TransitionRoute.canTransitionFrom,To() doc update (#25477)
This commit is contained in:
@@ -257,16 +257,55 @@ abstract class TransitionRoute<T> extends OverlayRoute<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether this route can perform a transition to the given route.
|
||||
/// Returns true if this route supports a transition animation that runs
|
||||
/// when [nextRoute] is pushed on top of it or when [nextRoute] is popped
|
||||
/// off of it.
|
||||
///
|
||||
/// Subclasses can override this method to restrict the set of routes they
|
||||
/// need to coordinate transitions with.
|
||||
///
|
||||
/// If true, and `nextRoute.canTransitionFrom()` is true, then the
|
||||
/// [buildTransitions] `secondaryAnimation` will run from 0.0 - 1.0
|
||||
/// when [nextRoute] is pushed on top of this one. Similarly, if
|
||||
/// the [nextRoute] is popped off of this route, the
|
||||
/// `secondaryAnimation` will run from 1.0 - 0.0.
|
||||
///
|
||||
/// If false, this route's [buildTransitions] `secondaryAnimation` parameter
|
||||
/// value will be [kAlwaysDismissedAnimation]. In other words, this route
|
||||
/// will not animate when when [nextRoute] is pushed on top of it or when
|
||||
/// [nextRoute] is popped off of it.
|
||||
///
|
||||
/// Returns true by default.
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [canTransitionFrom], which must be true for [nextRoute] for the
|
||||
/// [buildTransitions] `secondaryAnimation` to run.
|
||||
bool canTransitionTo(TransitionRoute<dynamic> nextRoute) => true;
|
||||
|
||||
/// Whether this route can perform a transition from the given route.
|
||||
/// Returns true if [previousRoute] should animate when this route
|
||||
/// is pushed on top of it or when then this route is popped off of it.
|
||||
///
|
||||
/// Subclasses can override this method to restrict the set of routes they
|
||||
/// need to coordinate transitions with.
|
||||
///
|
||||
/// If true, and `previousRoute.canTransitionTo()` is true, then the
|
||||
/// previous route's [buildTransitions] `secondaryAnimation` will
|
||||
/// run from 0.0 - 1.0 when this route is pushed on top of
|
||||
/// it. Similarly, if this route is popped off of [previousRoute]
|
||||
/// the previous route's `secondaryAnimation` will run from 1.0 - 0.0.
|
||||
///
|
||||
/// If false, then the previous route's [buildTransitions]
|
||||
/// `secondaryAnimation` value will be kAlwaysDismissedAnimation. In
|
||||
/// other words [previousRoute] will not animate when this route is
|
||||
/// pushed on top of it or when then this route is popped off of it.
|
||||
///
|
||||
/// Returns true by default.
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [canTransitionTo], which must be true for [previousRoute] for its
|
||||
/// [buildTransitions] `secondaryAnimation` to run.
|
||||
bool canTransitionFrom(TransitionRoute<dynamic> previousRoute) => true;
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user