addRoute method
Adds a route that responds to the given path for requests with the given method (case-insensitive). Provide '*' as the method to respond to all methods.
Implementation
Route<T> addRoute(String method, String path, T handler,
{Iterable<T> middleware = const []}) {
if (_useCache == true) {
throw StateError('Cannot add routes after caching is enabled.');
}
// Check if any mounted routers can match this
final handlers = <T>[handler];
//middleware ??= <T>[];
handlers.insertAll(0, middleware);
final route = Route<T>(path, method: method, handlers: handlers);
_routes.add(route);
return route;
}