Route class

Constructors

Route()
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
routes → List<RouteData>
get list of routes registered
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setRoutes(List<RouteData> routeList) → void
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

copy(String route, dynamic controller) → Route
copy route
delete(String route, dynamic controller) → Route
delete route
disabledCors(dynamic callback()) → void
Route.disabledCors() { Route.get('/ping', controller); });
domain(String domain, dynamic callback()) → void
domain route
enabledCors(dynamic callback()) → void
group of route to enabled cors
get(String route, dynamic controller) → Route
get route
group(String prefix, dynamic callback()) → void
group route
link route
lock(String route, dynamic controller) → Route
lock route
middleware(List middleware, dynamic callback()) → void
middleware for group of routes
options(String route, dynamic controller) → Route
options route
patch(String route, dynamic controller) → Route
patch route
post(String route, dynamic controller, {Function? request}) → Route
post route
prefix(String prefix) → void
set prefix for the route, this will affect its below routes
propfind(String route, dynamic controller) → Route
propfind route
purge(String route, dynamic controller) → Route
purge route
put(String route, dynamic controller) → Route
put route
resetWithNewMiddleware(List middleware) → void
set global middleware this will remove previous middleware and update new middleware from input input can be list for single middleware
resource(String route, dynamic controller) → Route
resource route
unlink route
unlock(String route, dynamic controller) → Route
unlock route
use(dynamic middleware) → void
add global middleware
view(String route, dynamic controller) → Route
view route
websocket(String route, dynamic callback(WebsocketEvent), {List middleware = const <dynamic>[]}) → void
add websocket route For this usage, you must use dox-websocket package.