moveSelectingCellToEdgeOfRows method

  1. @override
void moveSelectingCellToEdgeOfRows(
  1. PlutoMoveDirection direction, {
  2. bool force = false,
  3. bool notify = true,
})
inherited

Implementation

@override
void moveSelectingCellToEdgeOfRows(
  PlutoMoveDirection direction, {
  bool force = false,
  bool notify = true,
}) {
  if (!direction.vertical) {
    return;
  }

  if (!force && isEditing == true) {
    return;
  }

  if (currentCell == null) {
    return;
  }

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

  final int rowIdx = direction.isUp ? 0 : refRows.length - 1;

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

  direction.isUp
      ? scroll.vertical!.jumpTo(0)
      : scroll.vertical!.jumpTo(scroll.maxScrollVertical);
}