removeSelection method

void removeSelection()

Remove the selected text

Implementation

void removeSelection() {
  final sel = selection;
  text = text.replaceRange(selection.start, selection.end, "");
  selection = sel.copyWith(
    baseOffset: sel.start,
    extentOffset: sel.start,
  );
}