setSelection method

void setSelection(
  1. TextSelection selection
)

Implementation

void setSelection(TextSelection selection) {
  start = min(selection.baseOffset, selection.extentOffset - 1);
  end = max(selection.baseOffset, selection.extentOffset - 1);
}