Router.module constructor

Router.module({
  1. String prefix = '',
  2. List<Route> routes = const [],
  3. Object? metadata,
})

Creates the router a generated module exposes.

Both handler styles land here: a @Controller class exposes it from a routes getter, and a library of top-level handlers from a generated top-level getter.

Implementation

factory Router.module({
  String prefix = '',
  List<Route> routes = const [],
  Object? metadata,
}) {
  return Router._(
    prefix: normalizePrefix(prefix),
    routes: routes,
    metadata: metadata,
  );
}