deleteSelection method
void
deleteSelection()
Deletes the currently selected text range.
Implementation
void deleteSelection() {
if (!hasSelection) return;
final sel = selection!;
_text = _text.substring(0, sel.start) + _text.substring(sel.end);
_cursorPosition = sel.start;
clearSelection();
notifyListeners();
}