PageRouteInfo<T> class

Holds information of a named destination

Generated routes will extends this to make a sub-type that has all the corresponding page constructor arguments, it also adds a list of initialChildren e.g:

class BookListRoute extends PageRouteInfo {

Annotations

Constructors

PageRouteInfo(String _name, {List<PageRouteInfo>? initialChildren, T? args, Map<String, dynamic> rawPathParams = const {}, Map<String, dynamic> rawQueryParams = const {}, String fragment = '', String? stringMatch, String? redirectedFrom})
Default constructor
const
PageRouteInfo.fromMatch(RouteMatch match)
Creates a new instance form RouteMatch
factory

Properties

args → T?
The typed arguments of the route
final
flattened List<PageRouteInfo>
Returns a flattened list of this route and it's sub-routes e.g if we have = Route1[Route2Route3] the result is Route1,Route2,Route3
no setter
fragment String
The fragment of the Uri.fragment
final
fromRedirect bool
Whether is route is redirected from other route
no setter
hasChildren bool
Whether this route has initial child routes
no setter
hashCode int
The hash code for this object.
no setteroverride
initialChildren List<PageRouteInfo>?
The list of initial route entries to be matched by the sub-router when it's created
final
pathParams Parameters
Builds and returns a new instance of Parameters with rawPathParams
no setter
queryParams Parameters
Builds and returns a new instance of Parameters with rawQueryParams
no setter
rawPathParams Map<String, dynamic>
Route page parameters can be marked as a PathParam, and when this entity is generated it generates a corresponding parameter that's passed to this map so it can be used to build the url later on
final
rawQueryParams Map<String, dynamic>
Route page parameters can be marked as a QueryParam, and when this entity is generated it generates a corresponding parameter that's passed to this map so it can be used to build the url later on
final
redirectedFrom String?
Takes the value of RouteMatch.redirectedFrom this is only populated it's build from match PageRouteInfo.fromMatch
final
routeName String
The name of the route
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({String? name, String? path, T? args, RouteMatch? match, Map<String, dynamic>? params, Map<String, dynamic>? queryParams, List<PageRouteInfo>? children, String? fragment}) PageRouteInfo
Returns a new instance with the provided overrides
match(BuildContext context) RouteMatch?
Returns the match result of this route which internally calls router.matcher.matchByRoute
Calls StackRouter.navigate with this route on the nearest router
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
push<E>(BuildContext context) Future<E?>
Calls StackRouter.push with this route on the nearest router
toString() String
A string representation of this object.
override

Operators

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

Static Methods

expandPath(String template, Map<String, dynamic> params) String
Expends the path by populating it's dynamic-segments with their corresponding values from params e.g if template = '/products/:id' and params = {'id':'5'} the result is '/products/5'