Routemaster class

Provides access to router functionality.

For example: Routemaster.of(context).push('/path')

Properties

currentRoute RouteData
The current global route.
no setter
hashCode int
The hash code for this object.
no setterinherited
history RouteHistory
Allows navigating through the chronological history of routes.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pop<T extends Object?>([T? value]) Future<bool>
Pops the current route from the router. Returns true if the pop was successful, or false if it wasn't.
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.
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.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

of(BuildContext context) Routemaster
Retrieves the nearest ancestor Routemaster object.
setPathUrlStrategy() → void
Uses PathUrlStrategy on the web, which removes hashes from URLs. This must be called at app startup, before runApp is called.