moveSelectingCellToEdgeOfColumns method

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

Implementation

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

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

  if (currentCell == null) {
    return;
  }

  final int columnIdx = direction.isLeft ? 0 : refColumns.length - 1;

  final int? rowIdx = hasCurrentSelectingPosition
      ? currentSelectingPosition!.rowIdx
      : currentCellPosition!.rowIdx;

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

  direction.isLeft
      ? scroll.horizontal!.jumpTo(0)
      : scroll.horizontal!.jumpTo(scroll.maxScrollHorizontal);
}