visitChildren method

  1. @override
bool visitChildren(
  1. VisitorCallback visitor,
  2. TextStyle? parentStyle,
  3. AnnotationBuilder? annotation
)
override

Implementation

@override
bool visitChildren(
  VisitorCallback visitor,
  TextStyle? parentStyle,
  AnnotationBuilder? annotation,
) {
  final _style = parentStyle?.merge(style);
  final _annotation = this.annotation ?? annotation;

  if (text != null) {
    if (!visitor(this, _style, _annotation)) {
      return false;
    }
  }
  if (children != null) {
    for (final child in children!) {
      if (!child.visitChildren(visitor, _style, _annotation)) {
        return false;
      }
    }
  }
  return true;
}