setSelectionImmediately method
Implementation
void setSelectionImmediately(TextSelection newSelection) {
if (_selection == newSelection) return;
_flushBuffer();
final textLength = length;
final clampedBase = newSelection.baseOffset.clamp(0, textLength);
final clampedExtent = newSelection.extentOffset.clamp(0, textLength);
newSelection = newSelection.copyWith(
baseOffset: clampedBase,
extentOffset: clampedExtent,
);
_selection = newSelection;
selectionOnly = true;
_isTyping = false;
_scheduleSyncToConnection();
notifyListeners();
}