Skip to main content

TransitionRoute

Trait TransitionRoute 

Source
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’s T generic type argument.

Required Methods§

Source

fn transition_route_data(self: Handle<Self>, app: &App) -> &TransitionRouteData

Dart’s TransitionRoute fields, held under the field transition_route (transition_route_accessors!).

Source

fn transition_route_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut TransitionRouteData

Source

fn transition_duration(self: Handle<Self>, app: &mut App) -> Duration

The duration the transition going forwards.

See also:

Source

fn opaque(self: Handle<Self>, app: &App) -> bool

Whether the route obscures previous routes when the transition is complete.

When an opaque route’s entrance transition is complete, the routes behind the opaque route will not be built to save resources.

Provided Methods§

Source

fn as_transition_route(self: Handle<Self>) -> AnyTransitionRoute

This route as the erased AnyTransitionRoute.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn create_simulation_and_verify( self: Handle<Self>, app: &mut App, forward: bool, ) -> Option<Box<dyn Simulation>>

Dart’s _createSimulationAndVerify.

Source

fn handle_status_changed( self: Handle<Self>, app: &mut App, status: AnimationStatus, )

Dart’s _handleStatusChanged.

Source

fn install(self: Handle<Self>, app: &mut App)

Dart’s TransitionRoute.install.

Source

fn did_push(self: Handle<Self>, app: &mut App) -> TickerFuture ⓘ

Dart’s TransitionRoute.didPush.

Source

fn did_add(self: Handle<Self>, app: &mut App)

Dart’s TransitionRoute.didAdd.

Source

fn did_replace(self: Handle<Self>, app: &mut App, old_route: Option<AnyRoute>)

Dart’s TransitionRoute.didReplace.

Source

fn did_pop( self: Handle<Self>, app: &mut App, result: Option<Rc<dyn Any>>, ) -> bool

Dart’s TransitionRoute.didPop.

Source

fn did_pop_next(self: Handle<Self>, app: &mut App, next_route: AnyRoute)

Dart’s TransitionRoute.didPopNext.

Source

fn did_change_next( self: Handle<Self>, app: &mut App, next_route: Option<AnyRoute>, )

Dart’s TransitionRoute.didChangeNext.

Source

fn update_secondary_animation( self: Handle<Self>, app: &mut App, next_route: Option<AnyRoute>, )

Dart’s _updateSecondaryAnimation.

Source

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.

Source

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.

Source

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.

Source

fn handle_start_back_gesture(self: Handle<Self>, app: &mut App, progress: f64)

Dart’s TransitionRoute.handleStartBackGesture.

Source

fn handle_update_back_gesture_progress( self: Handle<Self>, app: &mut App, progress: f64, )

Dart’s TransitionRoute.handleUpdateBackGestureProgress.

Source

fn handle_cancel_back_gesture(self: Handle<Self>, app: &mut App)

Dart’s TransitionRoute.handleCancelBackGesture.

Source

fn handle_commit_back_gesture(self: Handle<Self>, app: &mut App)

Dart’s TransitionRoute.handleCommitBackGesture.

Source

fn handle_drag_end(self: Handle<Self>, app: &mut App, animate_forward: bool)

Dart’s _handleDragEnd.

Source

fn dispose(self: Handle<Self>, app: &mut App)

Dart’s TransitionRoute.dispose.

Source

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".

Implementors§