get<T> method

  1. @override
T get<T>()
override

Implementation

@override
T get<T>() {
  if (_singletons[T] case final T value?) {
    return value;
  }

  if (_lazySingletons[T] case final T Function() factory?) {
    return _singletons[T] = factory();
  }

  throw Exception(
    'Nothing found for type $T within $DI, did you forget to register it?',
  );
}