Router class

Constructors

Router()
factory

Properties

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

Methods

domain([String? domain]) Router
Adds a domain to the last added route.
middleware([List<Middleware>? middleware]) Router
Adds middleware to the last added route.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prefix([String? prefix]) Router
Adds a prefix to the last added route.
toString() String
A string representation of this object.
inherited
where(String paramName, String regex) Router
Specifies a custom regular expression for a parameter.
whereInt(String paramName) Router
Specifies a parameter as an integer.
whereString(String paramName) Router
Specifies a parameter as a string.

Operators

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

Static Methods

any(String path, Function action) Router
Adds a route that responds to any HTTP method.
basePrefix(String prefix) → void
Sets the base prefix for all routes.
copy(String path, Function action) Router
Adds a COPY route.
delete(String path, Function action) Router
Adds a DELETE route.
get(String path, Function action) Router
Adds a GET route.
group(Function callBack, {String? prefix, List<Middleware>? middleware, String? domain}) → void
Groups a set of routes under a common prefix, middleware, and/or domain.
Adds a LINK route.
lock(String path, Function action) Router
Adds a LOCK route.
options(String path, Function action) Router
Adds an OPTIONS route.
patch(String path, Function action) Router
Adds a PATCH route.
post(String path, Function action) Router
Adds a POST route.
propfind(String path, Function action) Router
Adds a PROPFIND route.
purge(String path, Function action) Router
Adds a PURGE route.
put(String path, Function action) Router
Adds a PUT route.
resource(String path, dynamic action) Router
Adds a set of resource routes.
Adds an UNLINK route.
unlock(String path, Function action) Router
Adds an UNLOCK route.
websocket(String path, dynamic eventCallBack(WebSocketEvent), {List<WebSocketMiddleware>? middleware}) → void
Adds a websocket route.