select method

void select(
  1. int start,
  2. int end, {
  3. TextAffinity affinity = TextAffinity.downstream,
})

Implementation

void select(int start, int end, {
  TextAffinity affinity = TextAffinity.downstream
}) {
  final sel = TextSelection(baseOffset: start, extentOffset: end, affinity: affinity);
  if(!controller.isSelectionWithinTextBounds(sel)) {
    throw AFException("Text selection from $start to $end is out of range for ${controller.text}");
  }
  controller.selection = sel;
}