Redirect class

Can be returned instead of a page to redirect the router to another path.

Redirect path can contain path parameters that reference path parameters of the original path by name.

E.g. defining route '/home/car/:id': (info) => Redirect('/cars/:id') in RouteMap and then calling Routermaster.of(context).push('/home/car/RAV4) will result in current path being '/cars/RAV4'.

Inheritance

Constructors

Redirect(String path, {Map<String, String>? queryParameters})
Initializes a redirect to the given path, with an optional map of queryParameters.
const

Properties

arguments Object?
The arguments passed to this route.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
key LocalKey?
The key associated with this page.
finalinherited
name String?
The name of the route (e.g., "/settings").
finalinherited
path String
The path to redirect to.
final
queryParameters Map<String, String>?
Query parameters to append to path when redirecting.
final
redirectPath String
The full redirect path, including queryParameters.
no setter
restorationId String?
Restoration ID to save and restore the state of the Route configured by this page.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canUpdate(Page other) bool
Whether this page can be updated with the other page.
inherited
createRoute(BuildContext context) Route
Creates the Route that corresponds to this page.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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