get<T> method

T get<T>()

Implementation

T get<T>() {
  if (_instances.containsKey(T)) {
    return _instances[T] as T;
  }
  if (_factories.containsKey(T)) {
    final instance = _factories[T]!();
    _instances[T] = instance;
    _log('Created instance of ${T.toString()}');
    return instance;
  }
  throw Exception('No factory registered for type $T');
}