RouteInformation class

A piece of routing information.

The route information consists of a location string of the application and a state object that configures the application in that location.

This information flows two ways, from the RouteInformationProvider to the Router or from the Router to RouteInformationProvider.

In the former case, the RouteInformationProvider notifies the Router widget when a new RouteInformation is available. The Router widget takes these information and navigates accordingly.

The latter case happens in web application where the Router reports route changes back to the web engine.

The current RouteInformation of an application is also used for state restoration purposes. Before an application is killed, the Router converts its current configurations into a RouteInformation object utilizing the RouteInformationProvider. The RouteInformation object is then serialized out and persisted. During state restoration, the object is deserialized and passed back to the RouteInformationProvider, which turns it into a configuration for the Router again to restore its state from.

Constructors

RouteInformation({@Deprecated('Pass Uri.parse(location) to uri parameter instead. ' 'This feature was deprecated after v3.8.0-3.0.pre.') String? location, Uri? uri, Object? state})
Creates a route information object.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
location String
The location of the application.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state Object?
The state of the application in the uri.
final
uri Uri
The uri location of the application.
no setter

Methods

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