watch method
Implementation
bool watch(BuildContext context, Entitlement entitlement) {
final Element element = context as Element;
if (_watchers[element] == null) {
late final StreamSubscription<void> subscription;
subscription = entitlementChanges.listen((_) {
if (element.mounted) {
element.markNeedsBuild();
return;
}
_watchers[element] = null;
unawaited(subscription.cancel());
});
_watchers[element] = subscription;
}
return holds(entitlement);
}