watch<T> static method
This will get the inherited element and call the
dependOnInheritedElement
method. The element will decide when to
rebuild the provided context
Implementation
static T watch<T>(BuildContext context, ProviderListenable<T> target) {
_ensureDebugDoingBuild(context, 'watch');
var elem = _getElementOrThrow(context);
context.dependOnInheritedElement(elem);
return elem._watch(context, target);
}