mountController<T extends Controller> method

Future<T> mountController<T extends Controller>([
  1. Type? type
])

Shorthand for using the container to instantiate, and then mount a Controller. Returns the created controller.

Just like Container.make, in contexts without properly-reified generics (dev releases of Dart 2), provide a type argument as well.

If you are on Dart >=2.0.0, simply call mountController<T>().

Implementation

Future<T> mountController<T extends Controller>([Type? type]) {
  var controller = container.make<T>(type);
  return configure(controller.configureServer).then((_) => controller);
}