spanText method

String spanText(
  1. DartValue? v
)

Text of a TextSpan tree, concatenated.

Implementation

String spanText(DartValue? v) {
  final d = deref(v);
  if (d is! ObjectValue) return '';
  final buffer = StringBuffer(text(d['text']));
  final children = deref(d['children']);
  if (children is ListValue) {
    for (final c in children.items) {
      buffer.write(spanText(c));
    }
  }
  return buffer.toString();
}