setSelection method

void setSelection([
  1. int start = 0,
  2. int end = 9999999,
  3. FocusNode? focusNode
])

Implementation

void setSelection([
  int start = 0,
  int end = 9999999,
  FocusNode? focusNode,
]) {
  selection = TextSelection(
    baseOffset: start.clamp(0, text.length),
    extentOffset: end.clamp(0, text.length),
  );
  focusNode?.requestFocus();
}