WinterRouter class

Inheritance
Implementers

Constructors

WinterRouter({List<Route>? routes, RouterConfig? config, String basePath = ''})
factory
WinterRouter.build({required List<Route> routes, required String basePath, required RouterConfig config})

Properties

basePath String
final
config RouterConfig
final
hashCode int
The hash code for this object.
no setterinherited
routes List<Route>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(String path, HttpMethod method, RequestHandler handler, {FilterConfig? filterConfig}) → void
addRoute(Route route) → void
canHandle(RequestEntity request) bool
Return true or false if this router can successfully process a request This means if the router if found, and the methods match
override
delete(String path, RequestHandler handler, {FilterConfig? filterConfig}) → void
get(String path, RequestHandler handler, {FilterConfig? filterConfig}) → void
handler(RequestEntity request) FutureOr<ResponseEntity>
override
handlerRoute(RequestEntity request) Route?
Return the route that will handle the request If a null value is returned, it means that this router can handle the request with a route It will return an status code like 404 or 415
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
options(String path, RequestHandler handler, {FilterConfig? filterConfig}) → void
patch(String path, RequestHandler handler, {FilterConfig? filterConfig}) → void
post(String path, RequestHandler handler, {FilterConfig? filterConfig}) → void
put(String path, RequestHandler handler, {FilterConfig? filterConfig}) → void
query(String path, RequestHandler handler, {FilterConfig? filterConfig}) → void
toString() String
A string representation of this object.
override

Operators

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