GoRouteData class abstract Type-safe routes
A class to represent a GoRoute in Type-safe routing.
Subclasses must override one of build, buildPage, or
redirect.
Constructors
- GoRouteData()
-
Allows subclasses to have
constconstructors.const
Properties
Methods
-
build(
BuildContext context, GoRouterState state) → Widget -
Creates the Widget for
thisroute.inherited -
buildPage(
BuildContext context, GoRouterState state) → Page< void> -
A page builder for this route.
inherited
-
go(
BuildContext context) → void - Navigate to the route.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onExit(
BuildContext context, GoRouterState state) → FutureOr< bool> -
Called when this route is removed from GoRouter's route history.
inherited
-
push<
T> (BuildContext context) → Future< T?> - Push the route onto the page stack.
-
pushReplacement(
BuildContext context) → void - Replaces the top-most page of the page stack with the route.
-
redirect(
BuildContext context, GoRouterState state) → FutureOr< String?> -
An optional redirect function for this route.
inherited
-
replace(
BuildContext context) → void - Replaces the top-most page of the page stack with the route but treats it as the same page.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
$location(
String path, {Map< String, dynamic> ? queryParams}) → String - A helper function used by generated code.
-
$route<
T extends GoRouteData> ({required String path, String? name, bool caseSensitive = true, required T factory(GoRouterState), List< RouteBase> routes = const <RouteBase>[]}) → GoRoute - A helper function used by generated code.