pub struct NavigatorState { /* private fields */ }Expand description
The state for a Navigator widget.
A reference to this class can be obtained by calling Navigator::of.
Implementations§
Sourcepub fn focus_node(self: Handle<Self>, app: &App) -> Handle<FocusNode>
pub fn focus_node(self: Handle<Self>, app: &App) -> Handle<FocusNode>
The focus node for this navigator.
The navigator will attempt to focus this node when the top-most route changes.
Sourcepub fn user_gesture_in_progress(self: Handle<Self>, app: &App) -> bool
pub fn user_gesture_in_progress(self: Handle<Self>, app: &App) -> bool
True if the state’s user_gesture_in_progress_notifier
value is true, meaning a route is being moved by a user gesture.
Sourcepub fn user_gesture_in_progress_notifier(
self: Handle<Self>,
app: &App,
) -> Handle<ValueNotifier<bool>>
pub fn user_gesture_in_progress_notifier( self: Handle<Self>, app: &App, ) -> Handle<ValueNotifier<bool>>
Notifies its listeners if the value of user_gesture_in_progress
changes.
Sourcepub fn overlay(
self: Handle<Self>,
app: &mut App,
) -> Option<Handle<OverlayState>>
pub fn overlay( self: Handle<Self>, app: &mut App, ) -> Option<Handle<OverlayState>>
The OverlayState of the Overlay this navigator builds, once it is mounted.
Sourcepub fn push_named(
self: Handle<Self>,
app: &mut App,
route_name: &str,
arguments: Option<Rc<dyn Any>>,
) -> CompleterFuture<RouteResult> ⓘ
pub fn push_named( self: Handle<Self>, app: &mut App, route_name: &str, arguments: Option<Rc<dyn Any>>, ) -> CompleterFuture<RouteResult> ⓘ
Push a named route onto the navigator.
The route name will be passed to Navigator::on_generate_route.
Returns a future that completes to the result value passed to pop when
the pushed route is popped off the navigator.
Sourcepub fn restorable_push_named(
self: Handle<Self>,
app: &mut App,
route_name: &str,
arguments: Option<RestorationData>,
) -> String
pub fn restorable_push_named( self: Handle<Self>, app: &mut App, route_name: &str, arguments: Option<RestorationData>, ) -> String
Push a named route onto the navigator and return its restoration ID.
The route name will be passed to Navigator::on_generate_route.
Sourcepub fn push_replacement_named(
self: Handle<Self>,
app: &mut App,
route_name: &str,
result: RouteResult,
arguments: Option<Rc<dyn Any>>,
) -> CompleterFuture<RouteResult> ⓘ
pub fn push_replacement_named( self: Handle<Self>, app: &mut App, route_name: &str, result: RouteResult, arguments: Option<Rc<dyn Any>>, ) -> CompleterFuture<RouteResult> ⓘ
Replace the current route of the navigator by pushing the route named route_name and
then disposing the previous route once the animation has completed.
Sourcepub fn restorable_push_replacement_named(
self: Handle<Self>,
app: &mut App,
route_name: &str,
result: RouteResult,
arguments: Option<RestorationData>,
) -> String
pub fn restorable_push_replacement_named( self: Handle<Self>, app: &mut App, route_name: &str, result: RouteResult, arguments: Option<RestorationData>, ) -> String
The restorable version of push_replacement_named.
Sourcepub fn pop_and_push_named(
self: Handle<Self>,
app: &mut App,
route_name: &str,
result: RouteResult,
arguments: Option<Rc<dyn Any>>,
) -> CompleterFuture<RouteResult> ⓘ
pub fn pop_and_push_named( self: Handle<Self>, app: &mut App, route_name: &str, result: RouteResult, arguments: Option<Rc<dyn Any>>, ) -> CompleterFuture<RouteResult> ⓘ
Pop the current route off the navigator and push a named route in its place.
Sourcepub fn restorable_pop_and_push_named(
self: Handle<Self>,
app: &mut App,
route_name: &str,
result: RouteResult,
arguments: Option<RestorationData>,
) -> String
pub fn restorable_pop_and_push_named( self: Handle<Self>, app: &mut App, route_name: &str, result: RouteResult, arguments: Option<RestorationData>, ) -> String
The restorable version of pop_and_push_named.
Sourcepub fn push_named_and_remove_until(
self: Handle<Self>,
app: &mut App,
new_route_name: &str,
predicate: RoutePredicate,
arguments: Option<Rc<dyn Any>>,
) -> CompleterFuture<RouteResult> ⓘ
pub fn push_named_and_remove_until( self: Handle<Self>, app: &mut App, new_route_name: &str, predicate: RoutePredicate, arguments: Option<Rc<dyn Any>>, ) -> CompleterFuture<RouteResult> ⓘ
Push the route with the given name onto the navigator, and then remove all the previous
routes until the predicate returns true.
Sourcepub fn restorable_push_named_and_remove_until(
self: Handle<Self>,
app: &mut App,
new_route_name: &str,
predicate: RoutePredicate,
arguments: Option<RestorationData>,
) -> String
pub fn restorable_push_named_and_remove_until( self: Handle<Self>, app: &mut App, new_route_name: &str, predicate: RoutePredicate, arguments: Option<RestorationData>, ) -> String
The restorable version of
push_named_and_remove_until.
Sourcepub fn push(
self: Handle<Self>,
app: &mut App,
route: RouteRef,
) -> CompleterFuture<RouteResult> ⓘ
pub fn push( self: Handle<Self>, app: &mut App, route: RouteRef, ) -> CompleterFuture<RouteResult> ⓘ
Push the given route onto the navigator.
Returns a future that completes to the result value passed to pop when
the pushed route is popped off the navigator.
Sourcepub fn restorable_push(
self: Handle<Self>,
app: &mut App,
route_builder: RestorableRouteBuilder,
arguments: Option<RestorationData>,
) -> String
pub fn restorable_push( self: Handle<Self>, app: &mut App, route_builder: RestorableRouteBuilder, arguments: Option<RestorationData>, ) -> String
Push a new route onto the navigator and return its restoration ID.
The route is created by route_builder, which is called again during state restoration.
Sourcepub fn push_replacement(
self: Handle<Self>,
app: &mut App,
new_route: RouteRef,
result: RouteResult,
) -> CompleterFuture<RouteResult> ⓘ
pub fn push_replacement( self: Handle<Self>, app: &mut App, new_route: RouteRef, result: RouteResult, ) -> CompleterFuture<RouteResult> ⓘ
Replace the current route of the navigator by pushing the given route and then disposing the previous route once the new route has finished animating in.
Sourcepub fn restorable_push_replacement(
self: Handle<Self>,
app: &mut App,
route_builder: RestorableRouteBuilder,
result: RouteResult,
arguments: Option<RestorationData>,
) -> String
pub fn restorable_push_replacement( self: Handle<Self>, app: &mut App, route_builder: RestorableRouteBuilder, result: RouteResult, arguments: Option<RestorationData>, ) -> String
The restorable version of push_replacement.
Sourcepub fn push_and_remove_until(
self: Handle<Self>,
app: &mut App,
new_route: RouteRef,
predicate: RoutePredicate,
) -> CompleterFuture<RouteResult> ⓘ
pub fn push_and_remove_until( self: Handle<Self>, app: &mut App, new_route: RouteRef, predicate: RoutePredicate, ) -> CompleterFuture<RouteResult> ⓘ
Push the given route onto the navigator, and then remove all the previous routes until the
predicate returns true.
Sourcepub fn restorable_push_and_remove_until(
self: Handle<Self>,
app: &mut App,
new_route_builder: RestorableRouteBuilder,
predicate: RoutePredicate,
arguments: Option<RestorationData>,
) -> String
pub fn restorable_push_and_remove_until( self: Handle<Self>, app: &mut App, new_route_builder: RestorableRouteBuilder, predicate: RoutePredicate, arguments: Option<RestorationData>, ) -> String
The restorable version of push_and_remove_until.
Sourcepub fn replace(
self: Handle<Self>,
app: &mut App,
old_route: AnyRoute,
new_route: RouteRef,
)
pub fn replace( self: Handle<Self>, app: &mut App, old_route: AnyRoute, new_route: RouteRef, )
Replaces a route on the navigator with a new route.
Sourcepub fn restorable_replace(
self: Handle<Self>,
app: &mut App,
old_route: AnyRoute,
new_route_builder: RestorableRouteBuilder,
arguments: Option<RestorationData>,
) -> String
pub fn restorable_replace( self: Handle<Self>, app: &mut App, old_route: AnyRoute, new_route_builder: RestorableRouteBuilder, arguments: Option<RestorationData>, ) -> String
The restorable version of replace.
Sourcepub fn replace_route_below(
self: Handle<Self>,
app: &mut App,
anchor_route: AnyRoute,
new_route: RouteRef,
)
pub fn replace_route_below( self: Handle<Self>, app: &mut App, anchor_route: AnyRoute, new_route: RouteRef, )
Replaces a route on the navigator with a new route. The route to be replaced is the one
below the given anchor_route.
Sourcepub fn restorable_replace_route_below(
self: Handle<Self>,
app: &mut App,
anchor_route: AnyRoute,
new_route_builder: RestorableRouteBuilder,
arguments: Option<RestorationData>,
) -> String
pub fn restorable_replace_route_below( self: Handle<Self>, app: &mut App, anchor_route: AnyRoute, new_route_builder: RestorableRouteBuilder, arguments: Option<RestorationData>, ) -> String
The restorable version of replace_route_below.
Sourcepub fn maybe_pop(self: Handle<Self>, app: &mut App, result: RouteResult) -> bool
pub fn maybe_pop(self: Handle<Self>, app: &mut App, result: RouteResult) -> bool
Consults the current route’s AnyRoute::pop_disposition method, and acts accordingly,
potentially popping the route as a result; returns whether the pop request should be
considered handled.
Sourcepub fn pop(self: Handle<Self>, app: &mut App, result: RouteResult)
pub fn pop(self: Handle<Self>, app: &mut App, result: RouteResult)
Pop the top-most route off the navigator.
Sourcepub fn pop_until(self: Handle<Self>, app: &mut App, predicate: RoutePredicate)
pub fn pop_until(self: Handle<Self>, app: &mut App, predicate: RoutePredicate)
Calls pop repeatedly until the predicate returns true.
Sourcepub fn pop_until_with_result(
self: Handle<Self>,
app: &mut App,
predicate: RoutePredicate,
result: RouteResult,
)
pub fn pop_until_with_result( self: Handle<Self>, app: &mut App, predicate: RoutePredicate, result: RouteResult, )
Calls pop repeatedly until the predicate returns true, passing result
to the last route that is popped.
Sourcepub fn remove_route(
self: Handle<Self>,
app: &mut App,
route: AnyRoute,
result: RouteResult,
)
pub fn remove_route( self: Handle<Self>, app: &mut App, route: AnyRoute, result: RouteResult, )
Immediately remove route from the navigator, and dispose of it.
Sourcepub fn remove_route_below(
self: Handle<Self>,
app: &mut App,
anchor_route: AnyRoute,
result: RouteResult,
)
pub fn remove_route_below( self: Handle<Self>, app: &mut App, anchor_route: AnyRoute, result: RouteResult, )
Immediately remove a route from the navigator, and dispose of it. The route to be removed
is the one below the given anchor_route.
Sourcepub fn finalize_route(self: Handle<Self>, app: &mut App, route: AnyRoute)
pub fn finalize_route(self: Handle<Self>, app: &mut App, route: AnyRoute)
Complete the lifecycle for a route that has been popped off the navigator.
When the navigator pops a route, the navigator retains a reference to the route in order
to call Route::dispose if the navigator itself is removed from the tree. When the
route is finished with any exit animation, the route should call this function to complete
its lifecycle (e.g., to receive a call to dispose).
Sourcepub fn did_start_user_gesture(self: Handle<Self>, app: &mut App)
pub fn did_start_user_gesture(self: Handle<Self>, app: &mut App)
Called when a route is about to be moved by a user gesture.
This is called by the route that is being moved, and is used to inform the observers.
Sourcepub fn did_stop_user_gesture(self: Handle<Self>, app: &mut App)
pub fn did_stop_user_gesture(self: Handle<Self>, app: &mut App)
A user gesture completed.
Notifies the navigator that a gesture regarding the navigation has stopped.
Trait Implementations§
Source§fn restoration_mixin_data(
self: Handle<Self>,
app: &App,
) -> &RestorationMixinData
fn restoration_mixin_data( self: Handle<Self>, app: &App, ) -> &RestorationMixinData
Source§fn restoration_mixin_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut RestorationMixinData
fn restoration_mixin_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut RestorationMixinData
Source§fn restoration_id(self: Handle<Self>, app: &App) -> Option<&str>
fn restoration_id(self: Handle<Self>, app: &App) -> Option<&str>
RestorationBucket in which the mixin will store the
restoration data of all registered properties. Read moreSource§fn restore_state(
self: Handle<Self>,
app: &mut App,
_old_bucket: Option<Handle<RestorationBucket>>,
_initial_restore: bool,
)
fn restore_state( self: Handle<Self>, app: &mut App, _old_bucket: Option<Handle<RestorationBucket>>, _initial_restore: bool, )
Source§fn did_toggle_bucket(
self: Handle<Self>,
app: &mut App,
old_bucket: Option<Handle<RestorationBucket>>,
)
fn did_toggle_bucket( self: Handle<Self>, app: &mut App, old_bucket: Option<Handle<RestorationBucket>>, )
Source§fn bucket(self: Handle<Self>, app: &App) -> Option<Handle<RestorationBucket>>
fn bucket(self: Handle<Self>, app: &App) -> Option<Handle<RestorationBucket>>
RestorationBucket used for the restoration data of the RestorablePropertys
registered to this mixin. Read moreSource§fn register_for_restoration(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
restoration_id: &str,
)
fn register_for_restoration( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, restoration_id: &str, )
RestorableProperty for state restoration. Read moreSource§fn unregister_from_restoration(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
)
fn unregister_from_restoration( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, )
RestorableProperty from state restoration. Read moreSource§fn did_update_restoration_id(self: Handle<Self>, app: &mut App)
fn did_update_restoration_id(self: Handle<Self>, app: &mut App)
restoration_id
changes. Read moreSource§fn restore_pending(self: Handle<Self>, app: &mut App) -> bool
fn restore_pending(self: Handle<Self>, app: &mut App) -> bool
restore_state will be called at the beginning of the
next build phase. Read moreSource§fn did_change_dependencies_restoration(self: Handle<Self>, app: &mut App)
fn did_change_dependencies_restoration(self: Handle<Self>, app: &mut App)
RestorationMixin.didChangeDependencies, called by the State from its own
State::did_change_dependencies.Source§fn dispose_restoration(self: Handle<Self>, app: &mut App)
fn dispose_restoration(self: Handle<Self>, app: &mut App)
Source§fn as_restoration_mixin(self: Handle<Self>) -> AnyRestorationMixin
fn as_restoration_mixin(self: Handle<Self>) -> AnyRestorationMixin
AnyRestorationMixin — what a RestorableProperty keeps as
its owner.Source§fn do_restore(
self: Handle<Self>,
app: &mut App,
old_bucket: Option<Handle<RestorationBucket>>,
)
fn do_restore( self: Handle<Self>, app: &mut App, old_bucket: Option<Handle<RestorationBucket>>, )
_doRestore.Source§fn update_bucket_if_necessary(
self: Handle<Self>,
app: &mut App,
parent: Option<Handle<RestorationBucket>>,
restore_pending: bool,
) -> bool
fn update_bucket_if_necessary( self: Handle<Self>, app: &mut App, parent: Option<Handle<RestorationBucket>>, restore_pending: bool, ) -> bool
_updateBucketIfNecessary. Returns true if bucket has been
replaced with a new bucket; it is the responsibility of the caller to dispose the old
bucket when this returns true.Source§fn set_new_bucket_if_necessary(
self: Handle<Self>,
app: &mut App,
new_bucket: Option<Ref<RestorationBucket>>,
restore_pending: bool,
) -> bool
fn set_new_bucket_if_necessary( self: Handle<Self>, app: &mut App, new_bucket: Option<Ref<RestorationBucket>>, restore_pending: bool, ) -> bool
_setNewBucketIfNecessary. Returns true if bucket has been
replaced with a new bucket; it is the responsibility of the caller to dispose the old
bucket when this returns true.Source§fn update_property(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
)
fn update_property( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, )
_updateProperty.Source§fn unregister(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
)
fn unregister( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, )
RestorationMixin._unregister.Source§fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
state
(state_accessors!).Source§fn state_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut StateData<Self::Widget>
fn state_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut StateData<Self::Widget>
state_data.Source§fn init_state(self: Handle<Self>, app: &mut App)
fn init_state(self: Handle<Self>, app: &mut App)
Source§fn did_change_dependencies(self: Handle<Self>, app: &mut App)
fn did_change_dependencies(self: Handle<Self>, app: &mut App)
Source§fn did_update_widget(self: Handle<Self>, app: &mut App, old_widget: &Navigator)
fn did_update_widget(self: Handle<Self>, app: &mut App, old_widget: &Navigator)
Source§fn deactivate(self: Handle<Self>, app: &mut App)
fn deactivate(self: Handle<Self>, app: &mut App)
Source§fn activate(self: Handle<Self>, app: &mut App)
fn activate(self: Handle<Self>, app: &mut App)
deactivate. Read moreSource§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Source§fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef
fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef
Source§fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
Source§fn context(self: Handle<Self>, app: &App) -> BuildContext
fn context(self: Handle<Self>, app: &App) -> BuildContext
Source§fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
Source§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties this state shows where its element’s dump
names it (state: ScrollableState#1a2b3(offset: 0.0)), after the lifecycle and mounting
properties State’s base adds, which the framework adds first.Source§fn create_ticker(
self: Handle<Self>,
app: &mut App,
on_tick: TickerCallback,
) -> Ref<Ticker>
fn create_ticker( self: Handle<Self>, app: &mut App, on_tick: TickerCallback, ) -> Ref<Ticker>
Source§fn ticker_provider_data(
self: Handle<Self>,
app: &App,
) -> &TickerProviderStateMixinData
fn ticker_provider_data( self: Handle<Self>, app: &App, ) -> &TickerProviderStateMixinData
Source§fn ticker_provider_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut TickerProviderStateMixinData
fn ticker_provider_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut TickerProviderStateMixinData
ticker_provider_data.Source§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
TickerProviderStateMixin.debugFillProperties, which a state’s own body calls
where Dart’s mixin adds its line.Source§fn create_ticker(
self: Handle<Self>,
app: &mut App,
on_tick: TickerCallback,
) -> Ref<Ticker>
fn create_ticker( self: Handle<Self>, app: &mut App, on_tick: TickerCallback, ) -> Ref<Ticker>
TickerProvider::create_ticker: creates a ticker with the given callback.