DVNavigatorRoute class

One entry in a Navigator 2.0 app's own route table: a path pattern and the page it builds for a matching location.

An app writes its own routes with it and spreads Dartvel's in beside them:

final List<DVNavigatorRoute> table = <DVNavigatorRoute>[
  DVNavigatorRoute('/profile', (Uri uri) => const MaterialPage(child: ProfileScreen())),
  ...dartvelNavigator2_0Routes(at: '/app', onLocationChanged: go),
];
// In the RouterDelegate's build:
Navigator(pages: [homePage, ...dvNavigatorPages(location, table)], ...)

The app's RouterDelegate stays in charge: it owns the location, the stack and the address bar, and asks the table which page a location is.

Constructors

DVNavigatorRoute(String pattern, Page<Object?> pageBuilder(Uri location))
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
pageBuilder → Page<Object?> Function(Uri location)
The page for a location this entry matches.
final
pattern → String
The path this entry answers, with :param segments and ** for the rest of a path, as go_router writes them.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

matches(Uri location) → bool
Whether this entry answers location's path. The query is not part of the match; it reaches the page with the location.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
page(Uri location) → Page<Object?>
toString() → String
A string representation of this object.
inherited

Operators

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