ServerRoute<P, S, D> class final

Server behavior attached to a neutral route definition.

Implemented types
Available extensions

Properties

children → List<RouteNode>
Child routes.
no setteroverride
definition → AppRoute<P, S, D>
The shared route definition.
final
handlers → Map<HttpMethod, ServerRouteHandler<P, S>>
Public HTTP handlers keyed by method.
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.
no setteroverride
load → ServerLoader<P, S, D>?
Optional server loader implementation.
final
metadata → RouteMetadata
Metadata shared by optional route capabilities.
no setteroverride
middleware → List<Middleware>
Middleware applied when this route is active.
final
path → String?
The route's relative or absolute path declaration.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
template → PathTemplate
The parsed path template.
no setteroverride
terminal → bool
Whether this route can be the final match for a location.
no setteroverride

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>[]}) → ServerRoute<P, S, D>
Binds generated file-system path information.
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
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
handle(HttpMethod method, RequestContext request, RouteMatches matches) → Future<ServerResponse>?
Runs the handler for method, or returns null when none exists.
handles(HttpMethod method) → bool
Whether this route handles method.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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.
runLoader(RequestContext context, RouteMatches matches) → FutureOr<Object?>
Runs this route's loader for the active branch.
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) → ServerRoute<P, S, D>
Returns a copy with children attached to the shared identity.

Operators

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