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.

Inheritance

Constructors

GoRouteData()
Allows subclasses to have const constructors.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
location String
The location of this route, e.g. /family/f2/person/p1
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context, GoRouterState state) Widget
Creates the Widget for this route.
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), GlobalKey<NavigatorState>? parentNavigatorKey, List<RouteBase> routes = const <RouteBase>[]}) GoRoute
A helper function used by generated code.