RouteHttp class final
HTTP route class, already equipped with constructors to handle Get, Post, Put, Delete
Patch, Head, Options, Trace but it's possible to customize and make your route work with more than one method.
Constructors
-
RouteHttp(String name, {required Middleware? middleware, List<
AcceptedMethods> ? acceptedMethods = const [AcceptedMethods.get, AcceptedMethods.post, AcceptedMethods.put, AcceptedMethods.delete, AcceptedMethods.patch, AcceptedMethods.head, AcceptedMethods.options, AcceptedMethods.trace], List<MiddlewareNullable> guards = const [], OpenApiOperation? openApi}) -
RouteHttp.delete(String name, {required Middleware? middleware, List<
MiddlewareNullable> guards = const [], OpenApiOperation? openApi, List<AcceptedMethods> ? acceptedMethods = const [AcceptedMethods.delete]}) -
RouteHttp.get(String name, {required Middleware? middleware, List<
MiddlewareNullable> guards = const [], OpenApiOperation? openApi, List<AcceptedMethods> ? acceptedMethods = const [AcceptedMethods.get]}) -
RouteHttp.head(String name, {required Middleware? middleware, List<
MiddlewareNullable> guards = const [], OpenApiOperation? openApi, List<AcceptedMethods> ? acceptedMethods = const [AcceptedMethods.head]}) -
RouteHttp.options(String name, {required Middleware? middleware, List<
MiddlewareNullable> guards = const [], OpenApiOperation? openApi, List<AcceptedMethods> ? acceptedMethods = const [AcceptedMethods.options]}) -
RouteHttp.patch(String name, {required Middleware? middleware, List<
MiddlewareNullable> guards = const [], OpenApiOperation? openApi, List<AcceptedMethods> ? acceptedMethods = const [AcceptedMethods.patch]}) -
RouteHttp.post(String name, {required Middleware? middleware, List<
MiddlewareNullable> guards = const [], OpenApiOperation? openApi, List<AcceptedMethods> ? acceptedMethods = const [AcceptedMethods.post]}) -
RouteHttp.put(String name, {required Middleware? middleware, List<
MiddlewareNullable> guards = const [], OpenApiOperation? openApi, List<AcceptedMethods> ? acceptedMethods = const [AcceptedMethods.put]}) -
RouteHttp.trace(String name, {required Middleware? middleware, List<
MiddlewareNullable> guards = const [], OpenApiOperation? openApi, List<AcceptedMethods> ? acceptedMethods = const [AcceptedMethods.trace]})
Properties
-
acceptedMethods
→ List<
AcceptedMethods> ? -
finalinherited
-
guards
→ List<
MiddlewareNullable> -
Middleware guards that run before the route handler.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDynamic → bool
-
Whether this route contains dynamic path segments (
:param).latefinalinherited - isHttpRoute → bool
-
Whether this route handles HTTP requests via middleware.
no setterinherited
- middleware → Middleware?
-
finalinherited
- middlewareWebSocket → MiddlewareWebSocket?
-
finalinherited
- name → String
-
finalinherited
- openApi → OpenApiOperation?
-
Optional OpenAPI documentation for this operation (OpenAPI 3.x).
finalinherited
-
pathParameterNames
→ List<
String> -
Names of path parameters (without the
:prefix), in path order.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- versionCache → int
-
no setterinherited
Methods
-
matchPath(
String path) → Map< String, String> ? -
Tries to match the given
pathagainst this route's pattern. Returns the extracted parameters if matched, ornullif no match.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onUpdate(
) → void -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited