dependency<T> method
Implementation
T dependency<T>({bool existingInstance = true}) {
try {
if (existingInstance) {
return (_cache[T] ?? (_cache[T] = _factory[T]!())) as T;
} else {
return _factory[T]!() as T;
}
} catch (e) {
throw DependencyNotFoundException<T>();
}
}