register<T> method

void register<T>(
  1. T instance, {
  2. String name = '',
  3. bool singleton = false,
})

Implementation

void register<T>(T instance, {String name = '', bool singleton = false}) {
  if (!_dependencies.containsKey(T)) {
    _dependencies[T] = {};
  }
  _dependencies[T]![name] = instance;
  if (singleton) {
    _singletons[T] = instance;
  }
}