add<T> abstract method

void add<T>(
  1. Function constructor, {
  2. BindConfig<T>? config,
  3. String? key,
})

Register a factory instance. A new instance will be generated whenever requested.

injector.add(MyController.new);

When [key] is provided this instance only can be found by key

Implementation

void add<T>(Function constructor, {BindConfig<T>? config, String? key});