notifyDependent method

  1. @override
void notifyDependent (covariant InheritedModel<T> oldWidget, Element dependent)
override

Called by notifyClients for each dependent.

Calls dependent.didChangeDependencies() by default.

Subclasses can override this method to selectively call didChangeDependencies based on the value of getDependencies.

See also:

Implementation

@override
void notifyDependent(InheritedModel<T> oldWidget, Element dependent) {
  final Set<T> dependencies = getDependencies(dependent);
  if (dependencies == null)
    return;
  if (dependencies.isEmpty || widget.updateShouldNotifyDependent(oldWidget, dependencies))
    dependent.didChangeDependencies();
}