get<T> method
Retrieves the value of the requested type T
or throws ProvidedValueNotFoundException when it can't be provided.
If watch
is not set, implementation should perform an educated guess (e.g. based on whether it's called during
a build).
Exact meaning of "watching" depends on the implementation and may not be supported.
Implementation
T get<T>({bool? watch}) {
final value = getUnsafe(T, watch: watch);
if (value == ProviderContext.valueNotFound) throw ProvidedValueNotFoundException(type: T, context: this);
return value as T;
}