Router class abstract

Spry Router interface.

Available extensions

Constructors

Router()
Create a new Router instance.
factory

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 a all 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 a connect 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 a delete route.
get(String path, Handler handler) → void

Available on Router, provided by the HttpVerbRouterExtension extension

Define a get route.
handle(String verb, String path, Context context) FutureOr<void>
Handle a HTTP verb request to a path.

Available on Router, provided by the HttpVerbRouterExtension extension

Define a head 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 given prefix.
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 a options 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 a post route.
put(String path, Handler handler) → void

Available on Router, provided by the HttpVerbRouterExtension extension

Define a put 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 a trace 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 a Middleware to the router.