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
@protected
dynamic getUnsafe(Type type, {bool? watch}) {
assert(watch != true, "Watching is not supported in SimpleHookContext.getUnsafe()");
if (!_provided.containsKey(type)) return ProviderContext.valueNotFound;
return _provided[type];
}