instance<T> method

  1. @override
void instance<T>(
  1. T instance
)
override

Registers an already created instance as a singleton.

Useful for registering pre-configured objects or third-party instances that don't need factory functions.

T - The type of the instance instance - The pre-created instance to register

Implementation

@override
void instance<T>(T instance) {
  _instances[T] = instance;
}