RoutemasterDelegate class
A delegate that is used by the Router widget to manage navigation.
- Inheritance
-
- Object
- Listenable
- RouterDelegate<
RouteData> - RoutemasterDelegate
- Mixed in types
Constructors
-
RoutemasterDelegate({required RouteMap routesBuilder(BuildContext context), TransitionDelegate? transitionDelegate, List<
NavigatorObserver> observers = const [], }) - Initializes the delegate.
-
RoutemasterDelegate.builder({required RouteMap routesBuilder(BuildContext context), List<
NavigatorObserver> observers = const []}) - Initializes the delegate with a custom PageStackNavigator builder via navigatorBuilder. For instance, if you wanted to add a observer to just the top-level navigator.
Properties
- currentConfiguration → RouteData?
-
Called by the Router when it detects a route information may have
changed as a result of rebuild.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- history → RouteHistory
-
Allows navigating through the chronological history of routes.
no setter
-
A function that returns the top-level navigator widgets. Normally this
function would return a PageStackNavigator.
final
-
An optional key that's passed to the top-level Navigator widget.
final
-
observers
→ List<
NavigatorObserver> -
A list of observers for the router, and nested Navigator widgets.
final
- routesBuilder → RouteMap Function(BuildContext context)
-
A function that returns a map of routes, to create pages from paths.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transitionDelegate → TransitionDelegate?
-
Specifies how the top-level Navigator transitions between routes.
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
build(
BuildContext context) → Widget -
Called by the Router to obtain the widget tree that represents the
current state.
override
-
dispose(
) → void -
Disposes the delegate. The delegate must not be used once this method has
been called.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
pop<
T extends Object?> ([T? result]) → Future< bool> -
Attempts to pops the top-level route. Returns
true
if a route was successfully popped, otherwisefalse
. -
popRoute(
) → Future< bool> -
Called by the Router when the Router.backButtonDispatcher reports that
the operating system is requesting that the current route be popped, for
instance on Android when the user presses the device's back button.
override
-
popUntil(
bool predicate(RouteData routeData)) → Future< void> -
Calls pop repeatedly whilst the
predicate
function returns true. -
push<
T extends Object?> (String path, {Map< String, String> ? queryParameters}) → NavigationResult<T> -
Navigates to
path
. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
replace(
String path, {Map< String, String> ? queryParameters}) → void -
Replaces the current route with
path
. On the web, this prevents the user returning to the previous route via the back button. -
setInitialRoutePath(
RouteData configuration) → Future< void> -
Called by the Router at startup with the structure that the
RouteInformationParser obtained from parsing the initial route.
override
-
setNewRoutePath(
RouteData configuration) → Future< void> -
Called by the Router when the Router.routeInformationProvider reports that a
new route has been pushed to the application by the operating system.
override
-
setRestoredRoutePath(
RouteData configuration) → Future< void> -
Called by the Router during state restoration.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited