AppRoute<P, S, D> class final

A typed route definition shared by manual and file routing.

Implemented types
Available extensions

Constructors

AppRoute({String? path, PathParams<P>? params, SearchParams<S>? search, RouteMetadata metadata = const RouteMetadata(), bool terminal = true, Iterable<RouteNode> children = const <RouteNode>[]})
Creates a route definition.
factory

Properties

children → List<RouteNode>
Child routes.
final
hashCode → int
The hash code for this object.
no setterinherited
hasPathCodec → bool
Whether dynamic path values have a typed codec.
no setteroverride
identity → Object
Stable identity shared by compiled route variants.
final
metadata → RouteMetadata
Metadata shared by optional route capabilities.
final
params → PathParams<P>?
The typed path contract, when the route owns dynamic path segments.
final
path → String?
The route's relative or absolute path declaration.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
The typed search contract, when the route owns query state.
final
template → PathTemplate
The parsed path template.
no setteroverride
terminal → bool
Whether this route can be the final match for a location.
final

Methods

capability<T extends Object>(RouteCapability<T> key) → T?
Reads an optional capability attached by another package entrypoint.
override
compiled({required String path, PathParams<P>? params, SearchParams<S>? search, required bool terminal, Iterable<RouteNode> children = const <RouteNode>[]}) → AppRoute<P, S, D>
Binds a file-system path and generated codecs to this definition.
decodePath(Map<String, List<String>> values) → Object?
Decodes this route's path parameters.
override
decodeQuery(Map<String, List<String>> values) → DecodedSearch<Object?>
Decodes this route's search state.
override
document(DocumentBuilder<P, S, D> builder) → AppRoute<P, S, D>

Available on AppRoute<P, S, D>, provided by the AppRouteDocument extension

Returns the route with builder installed as an optional capability.
encodePath(Object? params) → List<String>
Encodes this route's local path through the generated boundary.
override
encodeQuery(Object? search) → Map<String, List<String>>
Encodes this route's local search state.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
page({PageLoader<P, S, D>? load, RouteWidgetBuilder<P, S, D>? build, RoutePageBuilder<P, S, D>? page, RoutePendingBuilder<P, S>? pending, RouteErrorBuilder<P, S>? error, RouteNotFoundBuilder<P, S>? notFound}) → PageRoute<P, S, D>

Available on AppRoute<P, S, D>, provided by the AppRoutePage extension

Creates a Flutter page route.
ref({required P params, S? search}) → RouteRef<P, S, D>

Available on TypedRoute<P, S, D>, provided by the ParameterizedRouteReference extension

Creates a local route reference.
ref({S? search}) → RouteRef<NoParams, S, D>

Available on TypedRoute<NoParams, S, D>, provided by the StaticRouteReference extension

Creates a local route reference.
server({ServerLoader<P, S, D>? load, Iterable<Middleware> middleware = const <Middleware>[], Map<HttpMethod, ServerRouteHandler<P, S>>? handlers}) → ServerRoute<P, S, D>

Available on AppRoute<P, S, D>, provided by the AppRouteServer extension

Creates a server route.
shell({PageLoader<P, S, D>? load, required RouteShellBuilder<P, S, D> build, RoutePendingBuilder<P, S>? pending, RouteErrorBuilder<P, S>? error, RouteNotFoundBuilder<P, S>? notFound}) → ShellRoute<P, S, D>

Available on AppRoute<P, S, D>, provided by the AppRouteShell extension

Creates a Flutter shell route.
to({required P params, S? search}) → Destination

Available on TypedRoute<P, S, D>, provided by the ParameterizedRouteReference extension

Builds a destination containing only this route.
to({S? search}) → Destination

Available on TypedRoute<NoParams, S, D>, provided by the StaticRouteReference extension

Builds a destination containing only this route.
toString() → String
A string representation of this object.
inherited
withChildren(Iterable<RouteNode> children) → AppRoute<P, S, D>
Returns a copy with children attached to the same definition.

Operators

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