RouteData class

Information generated from a specific path (URL).

This object has value equality: objects are equal if the paths match.

Constructors

RouteData(String fullPath, {required String? pathTemplate, Map<String, String> pathParameters = const {}, bool isReplacement = false, RequestSource requestSource = RequestSource.system, int? historyIndex})
Initializes routing data from a path string.

Properties

fullPath String
The full path that generated this route, including query string.
no setter
hashCode int
The hash code for this object.
no setteroverride
isReplacement bool
Did this route replace the previous one, preventing the user from returning to it.
final
path String
The path component of this route, without query string.
no setter
pathParameters Map<String, String>
Query parameters from the path.
final
pathTemplate String?
The template for this route, for instance '/profile/:id'.
final
publicPath String
The user-visible path for this route, shown in a browser's address bar.
no setter
queryParameters Map<String, String>
Query parameters from the path.
no setter
requestSource RequestSource
The source of the original navigation request for this route. See RequestSource for the options.
final
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
toRouteInformation() RouteInformation
Creates a RouteInformation object with data from this route.
toString() String
A string representation of this object.
override

Operators

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

Static Methods

fromRouteInformation(RouteInformation routeInfo) RouteData
Creates a RouteData from a RouteInformation.
maybeOf(BuildContext context) RouteData?
Gets the RouteData for the nearest Page ancestor for the given context, or null if the given context doesn't have associated RouteData.
of(BuildContext context) RouteData
Gets the RouteData for the nearest Page ancestor for the given context.