GoRouteData class Null safety Type-safe routes

Baseclass for supporting typed routing.

Subclasses must override one of build, buildPageWithState, or redirect.

Constructors

GoRouteData()
Allows subclasses to have const constructors.
const

Properties

hashCode int
The hash code for this object.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

build(BuildContext context) Widget
Creates the Widget for this route.
buildPage(BuildContext context) Page<void>
A page builder for this route.
@Deprecated('This method has been deprecated in favor of buildPageWithState. ' 'This feature was deprecated after v4.3.0.')
buildPageWithState(BuildContext context, GoRouterState state) Page<void>
A page builder for this route with GoRouterState.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
redirect() FutureOr<String?>
An optional redirect function for this route.
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, String>? queryParams}) String
A helper function used by generated code.
$route<T extends GoRouteData>({required String path, required T factory(GoRouterState), List<GoRoute> routes = const <GoRoute>[]}) GoRoute
A helper function used by generated code.