pub trait TransitionRoute: OverlayRoute + PredictiveBackRoute {
Show 36 methods
// Required methods
fn transition_route_data(
self: Handle<Self>,
app: &App,
) -> &TransitionRouteData;
fn transition_route_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut TransitionRouteData;
fn transition_duration(self: Handle<Self>, app: &mut App) -> Duration;
fn opaque(self: Handle<Self>, app: &App) -> bool;
// Provided methods
fn as_transition_route(self: Handle<Self>) -> AnyTransitionRoute { ... }
fn completed(
self: Handle<Self>,
app: &App,
) -> CompleterFuture<Option<Rc<dyn Any>>> ⓘ { ... }
fn reverse_transition_duration(
self: Handle<Self>,
app: &mut App,
) -> Duration { ... }
fn allow_snapshotting(self: Handle<Self>, app: &App) -> bool { ... }
fn finished_when_popped(self: Handle<Self>, app: &App) -> bool { ... }
fn animation(self: Handle<Self>, app: &App) -> Option<AnyAnimation<f64>> { ... }
fn controller(
self: Handle<Self>,
app: &App,
) -> Option<Handle<AnimationController>> { ... }
fn secondary_animation(
self: Handle<Self>,
app: &App,
) -> Option<AnyAnimation<f64>> { ... }
fn debug_transition_completed(self: Handle<Self>, app: &App) -> bool { ... }
fn create_animation_controller(
self: Handle<Self>,
app: &mut App,
) -> Retained<Handle<AnimationController>> { ... }
fn create_animation(
self: Handle<Self>,
app: &mut App,
) -> Retained<AnyAnimation<f64>> { ... }
fn create_simulation(
self: Handle<Self>,
app: &mut App,
forward: bool,
) -> Option<Box<dyn Simulation>> { ... }
fn create_simulation_and_verify(
self: Handle<Self>,
app: &mut App,
forward: bool,
) -> Option<Box<dyn Simulation>> { ... }
fn handle_status_changed(
self: Handle<Self>,
app: &mut App,
status: AnimationStatus,
) { ... }
fn install(self: Handle<Self>, app: &mut App) { ... }
fn did_push(self: Handle<Self>, app: &mut App) -> TickerFuture ⓘ { ... }
fn did_add(self: Handle<Self>, app: &mut App) { ... }
fn did_replace(
self: Handle<Self>,
app: &mut App,
old_route: Option<AnyRoute>,
) { ... }
fn did_pop(
self: Handle<Self>,
app: &mut App,
result: Option<Rc<dyn Any>>,
) -> bool { ... }
fn did_pop_next(self: Handle<Self>, app: &mut App, next_route: AnyRoute) { ... }
fn did_change_next(
self: Handle<Self>,
app: &mut App,
next_route: Option<AnyRoute>,
) { ... }
fn update_secondary_animation(
self: Handle<Self>,
app: &mut App,
next_route: Option<AnyRoute>,
) { ... }
fn set_secondary_animation(
self: Handle<Self>,
app: &mut App,
animation: Option<Retained<AnyAnimation<f64>>>,
disposed: Option<CompleterFuture<Option<Rc<dyn Any>>>>,
) { ... }
fn can_transition_to(
self: Handle<Self>,
app: &App,
next_route: AnyTransitionRoute,
) -> bool { ... }
fn can_transition_from(
self: Handle<Self>,
app: &App,
previous_route: AnyTransitionRoute,
) -> bool { ... }
fn handle_start_back_gesture(
self: Handle<Self>,
app: &mut App,
progress: f64,
) { ... }
fn handle_update_back_gesture_progress(
self: Handle<Self>,
app: &mut App,
progress: f64,
) { ... }
fn handle_cancel_back_gesture(self: Handle<Self>, app: &mut App) { ... }
fn handle_commit_back_gesture(self: Handle<Self>, app: &mut App) { ... }
fn handle_drag_end(self: Handle<Self>, app: &mut App, animate_forward: bool) { ... }
fn dispose(self: Handle<Self>, app: &mut App) { ... }
fn debug_label(self: Handle<Self>) -> String { ... }
}Expand description
A route with entrance and exit transitions.
See also:
Route, which documents the meaning of Dart’sTgeneric type argument.
Required Methods§
Sourcefn transition_route_data(self: Handle<Self>, app: &App) -> &TransitionRouteData
fn transition_route_data(self: Handle<Self>, app: &App) -> &TransitionRouteData
Dart’s TransitionRoute fields, held under the field transition_route
(transition_route_accessors!).
Sourcefn transition_route_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut TransitionRouteData
fn transition_route_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut TransitionRouteData
Sourcefn transition_duration(self: Handle<Self>, app: &mut App) -> Duration
fn transition_duration(self: Handle<Self>, app: &mut App) -> Duration
The duration the transition going forwards.
See also:
reverse_transition_duration, which controls the duration of the transition when it is in reverse.
Provided Methods§
Sourcefn as_transition_route(self: Handle<Self>) -> AnyTransitionRoute
fn as_transition_route(self: Handle<Self>) -> AnyTransitionRoute
This route as the erased AnyTransitionRoute.
Sourcefn completed(
self: Handle<Self>,
app: &App,
) -> CompleterFuture<Option<Rc<dyn Any>>> ⓘ
fn completed( self: Handle<Self>, app: &App, ) -> CompleterFuture<Option<Rc<dyn Any>>> ⓘ
This future completes only once the transition itself has finished, after the overlay entries have been removed from the navigator’s overlay.
This future completes once the animation has been dismissed. That will be after
popped, because popped typically completes before the animation
even starts, as soon as the route is popped.
Sourcefn reverse_transition_duration(self: Handle<Self>, app: &mut App) -> Duration
fn reverse_transition_duration(self: Handle<Self>, app: &mut App) -> Duration
The duration the transition going in reverse.
By default, the reverse transition duration is set to the value of the forwards
transition_duration.
Sourcefn allow_snapshotting(self: Handle<Self>, app: &App) -> bool
fn allow_snapshotting(self: Handle<Self>, app: &App) -> bool
Whether the route transition will prefer to animate a snapshot of the entering and exiting routes.
Sourcefn finished_when_popped(self: Handle<Self>, app: &App) -> bool
fn finished_when_popped(self: Handle<Self>, app: &App) -> bool
Dart’s TransitionRoute.finishedWhenPopped.
This ensures that if we got to the dismissed state while still current, we will still be disposed when we are eventually popped.
Sourcefn animation(self: Handle<Self>, app: &App) -> Option<AnyAnimation<f64>>
fn animation(self: Handle<Self>, app: &App) -> Option<AnyAnimation<f64>>
The animation that drives the route’s transition and the previous route’s forward transition.
Sourcefn controller(
self: Handle<Self>,
app: &App,
) -> Option<Handle<AnimationController>>
fn controller( self: Handle<Self>, app: &App, ) -> Option<Handle<AnimationController>>
The animation controller that the route uses to drive the transitions.
The animation itself is exposed by animation.
Sourcefn secondary_animation(
self: Handle<Self>,
app: &App,
) -> Option<AnyAnimation<f64>>
fn secondary_animation( self: Handle<Self>, app: &App, ) -> Option<AnyAnimation<f64>>
The animation for the route being pushed on top of this route.
This animation lets this route coordinate with the entrance and exit transition of the route pushed on top of this route.
Sourcefn debug_transition_completed(self: Handle<Self>, app: &App) -> bool
fn debug_transition_completed(self: Handle<Self>, app: &App) -> bool
Returns true if the transition has completed.
It is equivalent to whether the future returned by completed has
completed.
This method only works when debug assertions are enabled. Otherwise it always returns false.
Sourcefn create_animation_controller(
self: Handle<Self>,
app: &mut App,
) -> Retained<Handle<AnimationController>>
fn create_animation_controller( self: Handle<Self>, app: &mut App, ) -> Retained<Handle<AnimationController>>
Called to create the animation controller that will drive the transitions to this route from the previous one, and back to the previous route from this one.
The returned controller will be disposed by AnimationController::dispose if
will_dispose_animation_controller
is true.
Sourcefn create_animation(
self: Handle<Self>,
app: &mut App,
) -> Retained<AnyAnimation<f64>>
fn create_animation( self: Handle<Self>, app: &mut App, ) -> Retained<AnyAnimation<f64>>
Called to create the animation that exposes the current progress of the transition
controlled by the animation controller created by
create_animation_controller.
Sourcefn create_simulation(
self: Handle<Self>,
app: &mut App,
forward: bool,
) -> Option<Box<dyn Simulation>>
fn create_simulation( self: Handle<Self>, app: &mut App, forward: bool, ) -> Option<Box<dyn Simulation>>
Creates the simulation that drives the transition animation for this route.
By default, this method returns None, indicating that the route doesn’t use
simulations, but initiates the transition by calling either AnimationController::forward
or AnimationController::reverse with
transition_duration and the controller’s curve.
Subclasses can override this method to return a simulation. In that case the
controller will instead use the provided simulation to animate the
transition using AnimationController::animate_with or
AnimationController::animate_back_with, and the simulation’s x is forwarded to the
value of animation. The controller’s curve and
transition_duration are ignored.
This method is invoked each time the navigator pushes or pops this route. The forward
parameter indicates the direction of the transition: true when the route is pushed, and
false when it is popped.
Sourcefn create_simulation_and_verify(
self: Handle<Self>,
app: &mut App,
forward: bool,
) -> Option<Box<dyn Simulation>>
fn create_simulation_and_verify( self: Handle<Self>, app: &mut App, forward: bool, ) -> Option<Box<dyn Simulation>>
Dart’s _createSimulationAndVerify.
Sourcefn handle_status_changed(
self: Handle<Self>,
app: &mut App,
status: AnimationStatus,
)
fn handle_status_changed( self: Handle<Self>, app: &mut App, status: AnimationStatus, )
Dart’s _handleStatusChanged.
Sourcefn did_push(self: Handle<Self>, app: &mut App) -> TickerFuture ⓘ
fn did_push(self: Handle<Self>, app: &mut App) -> TickerFuture ⓘ
Dart’s TransitionRoute.didPush.
Sourcefn did_replace(self: Handle<Self>, app: &mut App, old_route: Option<AnyRoute>)
fn did_replace(self: Handle<Self>, app: &mut App, old_route: Option<AnyRoute>)
Dart’s TransitionRoute.didReplace.
Sourcefn did_pop(
self: Handle<Self>,
app: &mut App,
result: Option<Rc<dyn Any>>,
) -> bool
fn did_pop( self: Handle<Self>, app: &mut App, result: Option<Rc<dyn Any>>, ) -> bool
Dart’s TransitionRoute.didPop.
Sourcefn did_pop_next(self: Handle<Self>, app: &mut App, next_route: AnyRoute)
fn did_pop_next(self: Handle<Self>, app: &mut App, next_route: AnyRoute)
Dart’s TransitionRoute.didPopNext.
Sourcefn did_change_next(
self: Handle<Self>,
app: &mut App,
next_route: Option<AnyRoute>,
)
fn did_change_next( self: Handle<Self>, app: &mut App, next_route: Option<AnyRoute>, )
Dart’s TransitionRoute.didChangeNext.
Sourcefn update_secondary_animation(
self: Handle<Self>,
app: &mut App,
next_route: Option<AnyRoute>,
)
fn update_secondary_animation( self: Handle<Self>, app: &mut App, next_route: Option<AnyRoute>, )
Dart’s _updateSecondaryAnimation.
Sourcefn set_secondary_animation(
self: Handle<Self>,
app: &mut App,
animation: Option<Retained<AnyAnimation<f64>>>,
disposed: Option<CompleterFuture<Option<Rc<dyn Any>>>>,
)
fn set_secondary_animation( self: Handle<Self>, app: &mut App, animation: Option<Retained<AnyAnimation<f64>>>, disposed: Option<CompleterFuture<Option<Rc<dyn Any>>>>, )
Dart’s _setSecondaryAnimation.
Sourcefn can_transition_to(
self: Handle<Self>,
app: &App,
next_route: AnyTransitionRoute,
) -> bool
fn can_transition_to( self: Handle<Self>, app: &App, next_route: AnyTransitionRoute, ) -> bool
Returns true if this route supports a transition animation that runs when next_route
is pushed on top of it or when next_route is popped off of it.
Subclasses can override this method to restrict the set of routes they need to coordinate transitions with.
Returns true by default.
Sourcefn can_transition_from(
self: Handle<Self>,
app: &App,
previous_route: AnyTransitionRoute,
) -> bool
fn can_transition_from( self: Handle<Self>, app: &App, previous_route: AnyTransitionRoute, ) -> bool
Returns true if previous_route should animate when this route is pushed on top of it
or when this route is popped off of it.
Subclasses can override this method to restrict the set of routes they need to coordinate transitions with.
Returns true by default.
Sourcefn handle_start_back_gesture(self: Handle<Self>, app: &mut App, progress: f64)
fn handle_start_back_gesture(self: Handle<Self>, app: &mut App, progress: f64)
Dart’s TransitionRoute.handleStartBackGesture.
Sourcefn handle_update_back_gesture_progress(
self: Handle<Self>,
app: &mut App,
progress: f64,
)
fn handle_update_back_gesture_progress( self: Handle<Self>, app: &mut App, progress: f64, )
Dart’s TransitionRoute.handleUpdateBackGestureProgress.
Sourcefn handle_cancel_back_gesture(self: Handle<Self>, app: &mut App)
fn handle_cancel_back_gesture(self: Handle<Self>, app: &mut App)
Dart’s TransitionRoute.handleCancelBackGesture.
Sourcefn handle_commit_back_gesture(self: Handle<Self>, app: &mut App)
fn handle_commit_back_gesture(self: Handle<Self>, app: &mut App)
Dart’s TransitionRoute.handleCommitBackGesture.
Sourcefn handle_drag_end(self: Handle<Self>, app: &mut App, animate_forward: bool)
fn handle_drag_end(self: Handle<Self>, app: &mut App, animate_forward: bool)
Dart’s _handleDragEnd.
Sourcefn debug_label(self: Handle<Self>) -> String
fn debug_label(self: Handle<Self>) -> String
A short description of this route useful for debugging.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".