visitChildren method
void
visitChildren({
- required void elementVisitor(
- ProviderElementBase element
- required void notifierVisitor(
- ProxyElementValueNotifier element
Visit the ProviderElements of providers that are listening to this element.
A provider is considered as listening to this element if it either watch or listen this element.
This method does not guarantee that a dependency is visited only once. If a provider both watch and listen an element, or if a provider listen multiple times to an element, it may be visited multiple times.
Implementation
void visitChildren({
required void Function(ProviderElementBase element) elementVisitor,
required void Function(ProxyElementValueNotifier element) notifierVisitor,
}) {
for (var i = 0; i < _providerDependents.length; i++) {
elementVisitor(_providerDependents[i]);
}
final dependents = _dependents;
if (dependents != null) {
for (var i = 0; i < dependents.length; i++) {
final dependent = dependents[i].source;
if (dependent is ProviderElementBase) elementVisitor(dependent);
}
}
}