moveCurrentCellByRowIdx method

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

Implementation

@override
void moveCurrentCellByRowIdx(
  int rowIdx,
  PlutoMoveDirection direction, {
  bool notify = true,
}) {
  if (!direction.vertical) {
    return;
  }

  if (rowIdx < 0) {
    rowIdx = 0;
  }

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

  final field = currentColumnField ?? refColumns.first.field;

  final cellToMove = refRows[rowIdx].cells[field];

  setCurrentCell(cellToMove, rowIdx, notify: notify);

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