groupAsync method

Future<SymlinkRoute<T>> groupAsync(
  1. String path,
  2. FutureOr<void> callback(
    1. Router<T> router
    ), {
  3. Iterable<T> middleware = const [],
  4. String name = '',
})

Asynchronous equivalent of group.

Implementation

Future<SymlinkRoute<T>> groupAsync(
    String path, FutureOr<void> Function(Router<T> router) callback,
    {Iterable<T> middleware = const [], String name = ''}) async {
  final router = Router<T>().._middleware.addAll(middleware);
  await callback(router);
  return mount(path, router)..name = name;
}