pub struct RestorableRouteFuture {
pub navigator_finder: NavigatorFinderCallback,
pub on_present: RoutePresentationCallback,
pub on_complete: Option<RouteCompletionCallback>,
/* private fields */
}Expand description
Gives access to a Route object and its return value that was added to a navigator via one
of its restorable* methods.
When a router is pushed with one of those methods, they return a restoration ID. That ID can
be used to obtain a RestorableRouteFuture, which stays valid across state restoration.
Fields§
A callback that given the BuildContext of the State object to which this property
is registered returns the NavigatorState of the navigator the route should be added
to.
on_present: RoutePresentationCallbackA callback that adds a route to the navigator and returns its restoration ID.
on_complete: Option<RouteCompletionCallback>A callback that is invoked when the route added by
on_present completes.
Implementations§
Source§impl RestorableRouteFuture
impl RestorableRouteFuture
Sourcepub fn new(
app: &mut App,
on_present: RoutePresentationCallback,
) -> Ref<RestorableRouteFuture>
pub fn new( app: &mut App, on_present: RoutePresentationCallback, ) -> Ref<RestorableRouteFuture>
Creates a RestorableRouteFuture; Dart’s optional arguments are the setters.
Dart RestorableRouteFuture(navigatorFinder:).
Sourcepub fn set_on_complete(
self: Handle<Self>,
app: &mut App,
on_complete: RouteCompletionCallback,
)
pub fn set_on_complete( self: Handle<Self>, app: &mut App, on_complete: RouteCompletionCallback, )
Dart RestorableRouteFuture(onComplete:).
Sourcepub fn present(
self: Handle<Self>,
app: &mut App,
arguments: Option<RestorationData>,
)
pub fn present( self: Handle<Self>, app: &mut App, arguments: Option<RestorationData>, )
Shows the route created by on_present.
Trait Implementations§
Source§impl ChangeNotifier for RestorableRouteFuture
impl ChangeNotifier for RestorableRouteFuture
fn change_notifier_data(&self) -> &ChangeNotifierData
fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData
Source§fn will_add_listener(self: Handle<Self>, app: &mut App)
fn will_add_listener(self: Handle<Self>, app: &mut App)
addListener that
work before super.addListener go here.Source§fn did_remove_listener(self: Handle<Self>, app: &mut App)
fn did_remove_listener(self: Handle<Self>, app: &mut App)
removeListener that
work after super.removeListener go here.Source§impl RestorableProperty for RestorableRouteFuture
impl RestorableProperty for RestorableRouteFuture
Source§fn restorable_property_data(
self: Handle<Self>,
app: &App,
) -> &RestorablePropertyData
fn restorable_property_data( self: Handle<Self>, app: &App, ) -> &RestorablePropertyData
RestorationMixin, held under the field property
(restorable_property_accessors!).Source§fn restorable_property_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut RestorablePropertyData
fn restorable_property_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut RestorablePropertyData
Source§fn create_default_value(self: Handle<Self>, _app: &mut App) -> Option<String>
fn create_default_value(self: Handle<Self>, _app: &mut App) -> Option<String>
RestorationMixin if no restoration data is available to restore the
value of the property from, to obtain the default value for the property. Read moreSource§fn from_primitives(
self: Handle<Self>,
_app: &mut App,
data: &RestorationData,
) -> Option<String>
fn from_primitives( self: Handle<Self>, _app: &mut App, data: &RestorationData, ) -> Option<String>
RestorationMixin to convert the data previously retrieved from
to_primitives back into an object of type
Value that this property should wrap. Read moreSource§fn init_with_value(self: Handle<Self>, app: &mut App, value: Option<String>)
fn init_with_value(self: Handle<Self>, app: &mut App, value: Option<String>)
RestorationMixin with the value returned by either
create_default_value or
from_primitives to set the value that this property currently
wraps. Read moreSource§fn to_primitives(self: Handle<Self>, app: &App) -> RestorationData
fn to_primitives(self: Handle<Self>, app: &App) -> RestorationData
RestorationMixin to retrieve the information that this property wants
to store in the restoration data. Read moreSource§fn enabled(self: Handle<Self>, app: &App) -> bool
fn enabled(self: Handle<Self>, app: &App) -> bool
to_primitives should
be included in the restoration state. Read moreSource§fn did_dispose(self: Handle<Self>, app: &mut App)
fn did_dispose(self: Handle<Self>, app: &mut App)
dispose: what a Dart override does after its
super.dispose() call.Source§fn dispose_property(self: Handle<Self>, app: &mut App)
fn dispose_property(self: Handle<Self>, app: &mut App)
RestorableProperty.dispose body. An override that runs super.dispose()
calls this.Source§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Source§fn is_registered(self: Handle<Self>, app: &App) -> bool
fn is_registered(self: Handle<Self>, app: &App) -> bool
RestorationMixin.Source§fn as_property(self: Handle<Self>) -> AnyRestorableProperty
fn as_property(self: Handle<Self>) -> AnyRestorableProperty
AnyRestorableProperty — what to pass where a Dart API
takes a RestorableProperty<Object?>.