GoRouterHelper extension

Dart extension to add navigation function to a BuildContext object, e.g. context.push('/');

on
  • BuildContext

Methods

back() → void
push(String location, {Object? extra}) Future<void>
Push a location onto the page stack.
pushNamed(String name, {Map<String, String> params = const <String, String>{}, Map<String, dynamic> queryParams = const <String, dynamic>{}, Object? extra}) Future<void>
Navigate to a named route onto the page stack.
replace(String location, {Object? extra}) → void
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> params = const <String, String>{}, Map<String, dynamic> queryParams = const <String, dynamic>{}, Object? extra}) → void
Replaces the top-most page with the named route and optional parameters, preserving the page key.