group method

  1. @override
SymlinkRoute<T> group(
  1. String path,
  2. void callback(
    1. Router<T> router
    ), {
  3. Iterable<T> middleware = const [],
  4. String? name,
})
override

Creates a route, and allows you to add child routes to it via a Router instance.

Returns the created route. You can also register middleware within the router.

Implementation

@override
SymlinkRoute<T> group(String path, void Function(Router<T> router) callback,
    {Iterable<T> middleware = const [], String? name}) {
  final router = ChainedRouter<T>(_root, [..._handlers, ...middleware]);
  callback(router);
  return mount(path, router)..name = name;
}