pub trait LocalHistoryRoute: TransitionRoute {
// Required methods
fn local_history_route_data(
self: Handle<Self>,
app: &App,
) -> &LocalHistoryRouteData;
fn local_history_route_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut LocalHistoryRouteData;
// Provided methods
fn add_local_history_entry(
self: Handle<Self>,
app: &mut App,
entry: Ref<LocalHistoryEntry>,
) { ... }
fn remove_local_history_entry(
self: Handle<Self>,
app: &mut App,
entry: Handle<LocalHistoryEntry>,
) { ... }
fn will_pop(self: Handle<Self>, app: &mut App) -> RoutePopDisposition { ... }
fn pop_disposition(self: Handle<Self>, app: &mut App) -> RoutePopDisposition { ... }
fn did_pop(self: Handle<Self>, app: &mut App, result: RouteResult) -> bool { ... }
fn will_handle_pop_internally(self: Handle<Self>, app: &App) -> bool { ... }
}Expand description
A mixin used by routes to handle back navigations internally by popping a list.
When a Navigator is instructed to pop, the current route is given an opportunity to
handle the pop internally. A LocalHistoryRoute handles the pop internally if its list of
local history entries is non-empty. Rather than being removed as the current route, the most
recent LocalHistoryEntry is removed from the list and its
LocalHistoryEntry::on_remove is called.
Required Methods§
Sourcefn local_history_route_data(
self: Handle<Self>,
app: &App,
) -> &LocalHistoryRouteData
fn local_history_route_data( self: Handle<Self>, app: &App, ) -> &LocalHistoryRouteData
Dart’s LocalHistoryRoute fields, held under the field local_history
(local_history_route_accessors!).
Sourcefn local_history_route_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut LocalHistoryRouteData
fn local_history_route_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut LocalHistoryRouteData
Provided Methods§
Sourcefn add_local_history_entry(
self: Handle<Self>,
app: &mut App,
entry: Ref<LocalHistoryEntry>,
)
fn add_local_history_entry( self: Handle<Self>, app: &mut App, entry: Ref<LocalHistoryEntry>, )
Adds a local history entry to this route.
When asked to pop, if this route has any local history entries, this route will handle the pop internally by removing the most recently added local history entry.
The given local history entry must not already be part of another local history route.
Sourcefn remove_local_history_entry(
self: Handle<Self>,
app: &mut App,
entry: Handle<LocalHistoryEntry>,
)
fn remove_local_history_entry( self: Handle<Self>, app: &mut App, entry: Handle<LocalHistoryEntry>, )
Removes a local history entry from this route.
The entry’s LocalHistoryEntry::on_remove callback, if any, is called synchronously.
Sourcefn will_pop(self: Handle<Self>, app: &mut App) -> RoutePopDisposition
fn will_pop(self: Handle<Self>, app: &mut App) -> RoutePopDisposition
Dart’s LocalHistoryRoute.willPop.
Sourcefn pop_disposition(self: Handle<Self>, app: &mut App) -> RoutePopDisposition
fn pop_disposition(self: Handle<Self>, app: &mut App) -> RoutePopDisposition
Dart’s LocalHistoryRoute.popDisposition.
Sourcefn did_pop(self: Handle<Self>, app: &mut App, result: RouteResult) -> bool
fn did_pop(self: Handle<Self>, app: &mut App, result: RouteResult) -> bool
Dart’s LocalHistoryRoute.didPop.
Sourcefn will_handle_pop_internally(self: Handle<Self>, app: &App) -> bool
fn will_handle_pop_internally(self: Handle<Self>, app: &App) -> bool
Dart’s LocalHistoryRoute.willHandlePopInternally.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".