replaceSelection method
Replaces the current selection with replacement.
Implementation
void replaceSelection(
String replacement, {
int? selectionStart,
int? selectionEnd,
}) {
final value = textController.value;
final range = _normalizedSelection(value);
replaceRange(
range,
replacement,
selection: _selectionForReplacement(
range.start,
replacement.length,
selectionStart,
selectionEnd,
),
);
}