moveSelectingCellByRowIdx method

  1. @override
void moveSelectingCellByRowIdx(
  1. int rowIdx,
  2. PlutoMoveDirection direction, {
  3. bool notify = true,
})
inherited

Implementation

@override
void moveSelectingCellByRowIdx(
  int rowIdx,
  PlutoMoveDirection direction, {
  bool notify = true,
}) {
  if (rowIdx < 0) {
    rowIdx = 0;
  }

  if (rowIdx > refRows.length - 1) {
    rowIdx = refRows.length - 1;
  }

  if (currentCell == null) {
    return;
  }

  int? columnIdx = hasCurrentSelectingPosition
      ? currentSelectingPosition!.columnIdx
      : currentCellPosition!.columnIdx;

  setCurrentSelectingPosition(
    cellPosition: PlutoGridCellPosition(
      columnIdx: columnIdx,
      rowIdx: rowIdx,
    ),
  );

  moveScrollByRow(direction, rowIdx - direction.offset);
}