addInstance<T> abstract method

void addInstance<T>(
  1. T instance, {
  2. BindConfig<T>? config,
  3. String? key,
})
inherited

Register a instance. A concrete object (Not a function).

injector.addInstance(MyController());

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

Implementation

void addInstance<T>(T instance, {BindConfig<T>? config, String? key});