Router class
Route registration DSL.
Constructors
- Router()
-
factory
Properties
Methods
-
acceptQuery(
List< String> mediaTypes) → Router -
The media types this
QUERYroute takes, such asapplication/json;type/*and*/*match a family or anything. A request with another type is answered with a 415, and the list is advertised in theAccept-Queryheader. -
domain(
[String? domain]) → Router -
middleware(
[List< Middleware> ? middleware]) → Router -
name(
[String? name]) → Router -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
prefix(
[String? prefix]) → Router -
toString(
) → String -
A string representation of this object.
inherited
-
where(
String paramName, String regex) → Router -
whereBool(
String paramName) → Router -
whereDouble(
String paramName) → Router -
whereInt(
String paramName) → Router -
whereString(
String paramName) → Router
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
any(
String path, Function action) → Router - A route for every HTTP method. Anything chained after it applies to all of them.
-
apiResource(
String path, dynamic controller, {String? prefix, List< Middleware> ? middleware, String? domain, String regex = r'\d+(\.\d+)?'}) → void -
The routes of a JSON API resource:
index,store,show,update(under both PUT and PATCH) anddestroy. -
basePrefix(
[String? prefix]) → void -
copy(
String path, Function action) → Router -
delete(
String path, Function action) → Router -
get(
String path, Function action) → Router -
group(
Function callback, {String? prefix = '', List< Middleware> middleware = const [], String? domain}) → void -
link(
String path, Function action) → Router -
lock(
String path, Function action) → Router -
options(
String path, Function action) → Router -
patch(
String path, Function action) → Router -
post(
String path, Function action) → Router -
propfind(
String path, Function action) → Router -
purge(
String path, Function action) → Router -
put(
String path, Function action) → Router -
query(
String path, Function action) → Router -
A
QUERYroute (RFC 10008): a safe, idempotent read likeGET, with the query in the request content instead of the URL — so it is not limited in length, and is less often written to logs on the way. -
resource(
String path, dynamic controller, {String? prefix, List< Middleware> ? middleware, String? domain, String regex = r'\d+(\.\d+)?'}) → void -
unlink(
String path, Function action) → Router -
unlock(
String path, Function action) → Router -
url(
String name, [Map< String, dynamic> ? params]) → String