updateSelection method

void updateSelection(
  1. int col,
  2. int row, {
  3. SelectionMode? mode,
})

Updates the selection endpoint to (col, row).

Implementation

void updateSelection(int col, int row, {SelectionMode? mode}) {
  if (_anchor == null) return;
  final modeChanged = mode != null && _mode != mode;
  if (modeChanged) {
    _mode = mode;
  }
  final newFocus = _clampPoint(col, row, _region);
  if (_focus == newFocus && !modeChanged) return;
  _focus = newFocus;
  notifyListeners();
}