textSpanToActualText function Null safety

String textSpanToActualText(
  1. InlineSpan textSpan
)

Implementation

String textSpanToActualText(InlineSpan textSpan) {
  final StringBuffer buffer = StringBuffer();

  textSpan.visitChildren((InlineSpan span) {
    if (span is SpecialInlineSpanBase) {
      buffer.write((span as SpecialInlineSpanBase).actualText);
    } else {
      // ignore: invalid_use_of_protected_member
      span.computeToPlainText(buffer);
    }
    return true;
  });
  return buffer.toString();
}