get<T> method
Use scope.get<T>(...)
to resolve instance from current scope:
final repository = scope.get<Repository>();
Provide name
to resolve instance with specific name:
final repository = scope.get<Repository>(name: 'repository');
This method will return instance if it's been exposed,
otherwise throws ScopeValueNotExposedError
when it's not exposed.
Implementation
T get<T>({
Object? name,
}) => has<T>(name: name)
? getOrNull<T>(name: name) as T
: throw ScopeValueNotExposedError<T>(name);