SimpleDataRoute<Data extends SimpleRouteData> class abstract

A route that contains one or more path and/or query parameters and/or "extra" data.

When navigating, a data object must be supplied to populate the route.

In this example, the MyRouteData class should provide a value for the :id path parameter (declared by the RouteParams.id enum value).

class MyRoute extends SimpleDataRoute<MyRouteData> {
  const MyRoute();

  @override
  String get path => joinSegments(['my-route', RouteParams.id.template]);
}

Constructors

SimpleDataRoute(String _path)
Create a SimpleDataRoute with the given path.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
path String
The path segment for this route, e.g. 'verify-email', used to configure the GoRoute.path for this route.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fullPath(Data data) String
Generate the full, populated path for this route using the supplied data.
go(BuildContext context, {required Data data}) → void
Navigate to this route using the supplied data.
isActive(GoRouterState state) bool
Determine if this route is active in any way.
inherited
isCurrentRoute(GoRouterState state) bool
Determine if this route is an exact match for the current location.
inherited
isParentRoute(GoRouterState state) bool
Determine if this route is a parent of the current route.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
push<T extends Object?>(BuildContext context, {required Data data}) Future<T?>
Push this route onto the stack using the supplied data.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited