Router class abstract
Spry Router interface.
- Available extensions
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
all(
String path, Handler handler) → void -
Available on Router, provided by the HttpVerbRouterExtension extension
Define aall
route. -
call(
Context context) → FutureOr< void> -
Cast the router to a spry
Handler
. -
connect(
String path, Handler handler) → void -
Available on Router, provided by the HttpVerbRouterExtension extension
Define aconnect
route. -
contains(
String verb, String path) → bool - Has a route been defined for the given HTTP verb and path segment?
-
delete(
String path, Handler handler) → void -
Available on Router, provided by the HttpVerbRouterExtension extension
Define adelete
route. -
get(
String path, Handler handler) → void -
Available on Router, provided by the HttpVerbRouterExtension extension
Define aget
route. -
handle(
String verb, String path, Context context) → FutureOr< void> - Handle a HTTP verb request to a path.
-
head(
String path, Handler handler) → void -
Available on Router, provided by the HttpVerbRouterExtension extension
Define ahead
route. -
merge(
Router router) → void - Merge the given Router into this Router.
-
mount(
String prefix, {Router? router, Handler? handler}) → void -
Mount a
Handler
or Router to the givenprefix
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
options(
String path, Handler handler) → void -
Available on Router, provided by the HttpVerbRouterExtension extension
Define aoptions
route. -
param(
String name, ParamMiddleware middleware) → void - Adds a ParamMiddleware to route parameters.
-
post(
String path, Handler handler) → void -
Available on Router, provided by the HttpVerbRouterExtension extension
Define apost
route. -
put(
String path, Handler handler) → void -
Available on Router, provided by the HttpVerbRouterExtension extension
Define aput
route. -
route(
String verb, String path, Handler handler) → void - Define a route for the given HTTP verb and path segment.
-
toString(
) → String -
A string representation of this object.
inherited
-
trace(
String path, Handler handler) → void -
Available on Router, provided by the HttpVerbRouterExtension extension
Define atrace
route. -
use(
Middleware middleware) → void -
Add a
Middleware
to the router.
Operators
-
operator &(
Router router) → Router -
Available on Router, provided by the RouterOperator extension
Merge the given Router into this Router. -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator |(
Middleware middleware) → Router -
Available on Router, provided by the RouterOperator extension
Register aMiddleware
to the router.