setCurrentCell method

  1. @override
void setCurrentCell(
  1. PlutoCell? cell,
  2. int? rowIdx, {
  3. bool notify = true,
})
inherited

Change the selected cell.

Implementation

@override
void setCurrentCell(
  PlutoCell? cell,
  int? rowIdx, {
  bool notify = true,
}) {
  if (cell == null ||
      rowIdx == null ||
      refRows.isEmpty ||
      rowIdx < 0 ||
      rowIdx > refRows.length - 1) {
    return;
  }

  if (currentCell != null && currentCell!.key == cell.key) {
    return;
  }

  _state._currentCell = cell;

  _state._currentCellPosition = PlutoGridCellPosition(
    rowIdx: rowIdx,
    columnIdx: columnIdxByCellKeyAndRowIdx(cell.key, rowIdx),
  );

  clearCurrentSelecting(notify: false);

  setEditing(autoEditing, notify: false);

  notifyListeners(notify, setCurrentCell.hashCode);
}