getUnsafe method
Retrieves the value of the requested type
and optionally watches for its change.
Returned values are guaranteed to be of type type
or valueNotFound when it isn't found.
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
@override
dynamic getUnsafe(Type type, {bool? watch}) {
assert(watch != true, "Watching a dependency is not supported in HookProviderContainer.getUnsafe()");
if(!_providers.containsKey(type)) return ProviderContext.valueNotFound;
return _providers[type]?.value;
}