GoRouterHelper extension
Dart extension to add navigation function to a BuildContext object, e.g. context.go('/');
- on
Methods
-
canPop(
) → bool -
Available on BuildContext, provided by the GoRouterHelper extension
Returnstrueif there is more than 1 page on the stack. -
go(
String location, {Object? extra}) → void -
Available on BuildContext, provided by the GoRouterHelper extension
Navigate to a location. -
goNamed(
String name, {Map< String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra, String? fragment}) → void -
Available on BuildContext, provided by the GoRouterHelper extension
Navigate to a named route. -
namedLocation(
String name, {Map< String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, String? fragment}) → String -
Available on BuildContext, provided by the GoRouterHelper extension
Get a location from route name and parameters. -
pop<
T extends Object?> ([T? result]) → void -
Available on BuildContext, provided by the GoRouterHelper 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 GoRouterHelper 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 GoRouterHelper extension
Navigate to a named route onto the page stack. -
pushReplacement(
String location, {Object? extra}) → void -
Available on BuildContext, provided by the GoRouterHelper 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(
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 GoRouterHelper 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(
String location, {Object? extra}) → void -
Available on BuildContext, provided by the GoRouterHelper extension
Replaces the top-most page of the page stack with the given one but treats it as the same page. -
replaceNamed(
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 GoRouterHelper extension
Replaces the top-most page with the named route and optional parameters, preserving the page key.