Route constructor
Route({
- required String path,
- required HttpMethod method,
- required RequestHandler handler,
- FilterConfig? filterConfig,
Implementation
factory Route({
required String path,
required HttpMethod method,
required RequestHandler handler,
FilterConfig? filterConfig,
}) {
if (!path.startsWith('/')) {
throw ArgumentError.value(
path,
'path',
'expected route to start with a slash',
);
}
return Route._(
path,
method,
handler,
filterConfig ?? const FilterConfig([]),
);
}