get<T> method

T get<T>()

Retrieves a registered dependency of type T.

Throws DependencyNotFoundException if the type is not registered.

Implementation

T get<T>() {
  final dependency = _registrations[T];
  if (dependency == null) {
    throw DependencyNotFoundException(T);
  }
  return dependency.get() as T;
}