visitChildrenOfAnyType method
The implementation should call visitor
for each immediate child of this object.
If visitor
returns false
it should return false
immediately, canceling
the iteration over its children.
Implementation
@override
bool visitChildrenOfAnyType(CancelableObjectVisitor visitor) {
var child = firstChild;
var i = 0;
for (final el in _internalTextAndWidgets) {
if (el is Widget) {
// Visit the child widget's render object.
if (!visitor(child!)) return false; //------------------------------>
child = childAfter(child);
} else if (el is WrappableText) {
// Visit all the text renderers.
final wtr = _cache[el.defaultKey]!;
for (final textRenderer in wtr.renderers) {
if (!visitor(textRenderer)) return false; //---------------------->
}
// Visit all the child render objects embedded in the text.
while (child != null && child.tag.index == i) {
if (!visitor(child)) return false; //----------------------------->
}
}
i++;
}
return true;
}