RouterConfiguration class
A configuration of router that can be use for easy & powerful navigations.
To use this for navigation, add instance of this to your MaterialApp
child: MaterialApp(
// ...
navigatorKey: navigationProvider.navigatorKey,
onGenerateRoute: navigationProvider.onGenerateRoute,
onUnknownRoute: navigationProvider.onUnknownRoute,
// ...
),
- Mixed in types
Constructors
-
RouterConfiguration({required List<
NavigationPathInterface> paths, List<NamedPath> ? namedPaths, NavigatorLogger? logger, RouteBuilder? routeBuilder}) - Creates a route configuration with paths for navigation.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastGeneratedRoute → Route?
-
Last route that was created from this RouterConfiguration.onGenerateRoute.
no setteroverride
-
This is responsible for responding to navigation requests made from
RouterConfiguration.navigateFromUri.
final
- logger → NavigatorLogger
-
A logger for logging navigation requests and issues.
final
-
namedPathsMap
→ Map<
String, NamedPath> -
List of
NamedPath
for route matching converted to a map ofString
toNamedPath
. When a named route is pushed with Navigator.pushNamed, the route name from settings is used to match with NamedPath.pathName from this map to retrieve builder.final -
A key to use when building the Navigator. Usually a reference to MaterialApp.navigatorKey.
final
-
no setteroverride
-
paths
↔ List<
NavigationPathInterface> -
List of NavigationPath for route matching. When a named route is pushed with
Navigator.pushNamed, the route name is matched with the NavigationPath.matcher
in the list below. As soon as there is a match, the associated builder
will be returned. This means that the paths higher up in the list will
take priority.
getter/setter pair
- routeBuilder → RouteBuilder?
-
A common route builder for all routes. Used when NavigationPath.routeBuilder is null.
If this value is null, then fallbacks to NoAnimationMaterialPageRoute on web and MaterialPageRoute for others.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
inherited
-
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onGenerateRoute(
RouteSettings settings) → Route? - The route generator callback used when the app is navigated to a named route. Set it on the MaterialApp.onGenerateRoute or WidgetsApp.onGenerateRoute to make use of the paths for route matching.
-
onUnknownRoute(
RouteSettings settings) → Route? -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited