visitChildren method
Walks this InlineSpan and any descendants in pre-order and calls visitor
for each span that has content.
When visitor returns true, the walk will continue. When visitor returns
false, then the walk will end.
See also:
- visitDirectChildren, which preforms
build-order traversal on the immediate children of this InlineSpan, regardless of whether they have content.
Implementation
@override
bool visitChildren(InlineSpanVisitor visitor) {
if (text != null && !visitor(this)) {
return false;
}
final List<InlineSpan>? children = this.children;
if (children != null) {
for (final InlineSpan child in children) {
if (!child.visitChildren(visitor)) {
return false;
}
}
}
return true;
}