GoRouterExtension extension Extensions

Supply a reference to the GoRouter itself.

dartdoc:

on

Methods

canPop() bool

Available on BuildContext, provided by the GoRouterExtension extension

Returns true if there is more than 1 page on the stack.
go(String location, {Object? extra}) → void

Available on BuildContext, provided by the GoRouterExtension extension

Navigate to a location.
goNamed(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra}) → void

Available on BuildContext, provided by the GoRouterExtension extension

Navigate to a named route.
namedLocation(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}}) String

Available on BuildContext, provided by the GoRouterExtension extension

Get a location from route name and parameters.
pop<T extends Object?>([T? result]) → void

Available on BuildContext, provided by the GoRouterExtension extension

Pop the top page off the Navigator's page stack by calling Navigator.pop.
push<T extends Object?>(String location, {Object? extra}) Future<T?>

Available on BuildContext, provided by the GoRouterExtension extension

Push a location onto the page stack.
pushNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra}) Future<T?>

Available on BuildContext, provided by the GoRouterExtension extension

Navigate to a named route onto the page stack.
pushReplacement<T extends Object?>(String location, {Object? extra}) Future<T?>

Available on BuildContext, provided by the GoRouterExtension extension

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?>

Available on BuildContext, provided by the GoRouterExtension extension

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'}.
replace<T>(String location, {Object? extra}) Future<T?>

Available on BuildContext, provided by the GoRouterExtension extension

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?>

Available on BuildContext, provided by the GoRouterExtension extension

Replaces the top-most page with the named route and optional parameters, preserving the page key.