add<T> method

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

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

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