setSelection method

void setSelection(
  1. int start,
  2. int end
)

Sets the selection range from start to end.

Implementation

void setSelection(int start, int end) {
  _selectionStart = start.clamp(0, _text.length);
  _selectionEnd = end.clamp(_selectionStart!, _text.length);
  notifyListeners();
}