addWhitespace method

TextBit addWhitespace ()

Adds a new whitespace to the tail of this container.

Implementation

TextBit addWhitespace() {
  final tail = last ?? prev;
  if (tail == null) return null;
  if (tail is _TextNewLine || tail is _TextWhitespace) return tail;

  final bit = _TextWhitespace(this);
  add(bit);
  return bit;
}