RouteInformation class Null safety

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.


RouteInformation({String? location, Object? state})
Creates a route information object.


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


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() String
A string representation of this object.


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