groupAsync method

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

Asynchronous equivalent of group.

Implementation

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