toPlainText method

String toPlainText ()

Flattens the TextSpan tree into a single string.

Styles are not honored in this process.

Implementation

String toPlainText() {
  assert(debugAssertIsValid());
  final StringBuffer buffer = StringBuffer();
  visitTextSpan((TextSpan span) {
    buffer.write(span.text);
    return true;
  });
  return buffer.toString();
}