replaceSelection method

void replaceSelection(
  1. String replacement, [
  2. String? select
])

Replace the selection(s) with the given string. By default, the new selection ends up after the inserted text. The optional select argument can be used to change this. Passing around: will cause the new text to be selected; start: will collapse the selection to the start of the inserted text.

Implementation

void replaceSelection(String replacement, [String? select]) {
  callArgs('replaceSelection',
      select != null ? [replacement, select] : [replacement]);
}