RouteTree class

Implemented types

Constructors

RouteTree.new({required List<RouteInfo> routeInfoList, required List<RouteBase> routes, Codec<Object?, Object?>? extraCodec, ExceptionHandler? onException, RouteTreePageBuilder? errorPageBuilder, RouteTreeWidgetBuilder? errorBuilder, RouteTreeRedirect? redirect, Listenable? refreshListenable, int redirectLimit = 5, bool routerNeglect = false, String? initialLocation, bool overridePlatformDefaultLocation = false, Object? initialExtra, List<NavigatorObserver>? observers, bool debugLogDiagnostics = false, GlobalKey<NavigatorState>? navigatorKey, String? restorationScopeId, bool requestFocus = true})

Properties

backButtonDispatcher BackButtonDispatcher
The BackButtonDispatcher that is used to configure the Router.
no setter
configuration ↔ RouteConfiguration
The route configuration used in go_router.
latefinal
hashCode int
The hash code for this object.
no setterinherited
overridePlatformDefaultLocation bool
Whether to ignore platform's default initial location when initialLocation is set.
no setter
routeInformationParser ↔ GoRouteInformationParser
The route information parser used by GoRouter.
latefinal
routeInformationProvider ↔ GoRouteInformationProvider
The route information provider used by GoRouter.
latefinal
router ↔ GoRouter
latefinal
routerDelegate ↔ GoRouterDelegate
The router delegate. Provide this to the MaterialApp or CupertinoApp's .router() constructor
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → GoRouterState
The top GoRouterState, the state of the route that was last used in either GoRouter.go or GoRouter.push.
no setterinherited

Methods

canPop() bool
Returns true if there is at least two or more route can be pop.
dispose() → void
Disposes resource created by this object.
go(String location, {Object? extra}) → void
Navigate to a URI location w/ optional query parameters, e.g. /family/f2/person/p1?color=blue
goNamed(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra}) → void
Navigate to a named route w/ optional parameters, e.g. name='person', pathParameters={'fid': 'f2', 'pid': 'p1'} Navigate to the named route.
namedLocation(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}}) String
Get a location from route name and parameters. This is useful for redirecting to a named location.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pop<T extends Object?>([T? result]) → void
Pop the top-most route off the current screen.
push<T extends Object?>(String location, {Object? extra}) Future<T?>
Push a URI location onto the page stack w/ optional query parameters, e.g. /family/f2/person/p1?color=blue.
pushNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra}) Future<T?>
Push a named route onto the page stack w/ optional parameters, e.g. name='person', pathParameters={'fid': 'f2', 'pid': 'p1'}
pushReplacement<T extends Object?>(String location, {Object? extra}) Future<T?>
Replaces the top-most page of the page stack with the given URL location w/ optional query parameters, e.g. /family/f2/person/p1?color=blue.
pushReplacementNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra}) Future<T?>
Replaces the top-most page of the page stack with the named route w/ optional parameters, e.g. name='person', pathParameters={'fid': 'f2', 'pid': 'p1'}.
refresh() → void
Refresh the route.
replace<T>(String location, {Object? extra}) Future<T?>
Replaces the top-most page of the page stack with the given one but treats it as the same page.
replaceNamed<T>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra}) Future<T?>
Replaces the top-most page with the named route and optional parameters, preserving the page key.
restore(RouteMatchList matchList) → void
Restore the RouteMatchList
toString() String
A string representation of this object.
inherited

Operators

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