clear method

void clear()

Replaces the whole content with an empty document. The wipe goes through replaceText, so it is a single undoable operation.

Implementation

void clear() {
  _pendingStyle = const Style();
  breakHistoryGroup();
  replaceText(
    0,
    _document.length - 1,
    '',
    const TextSelection.collapsed(offset: 0),
  );
}