use<T> static method
Returns the value provided for key
, or the keys default value if no
value was provided.
A MissingDependencyException will be thrown if the passed key
is not in scope.
A CircularDependencyException will be thrown if a circular dependency is discovered values provided by single or sequence.
Implementation
static T use<T>(ScopeKey<T> key, {T Function()? withDefault}) =>
_use(key, withDefault: withDefault);