execute method

  1. @override
void execute({
  1. required PlutoKeyManagerEvent keyEvent,
  2. required PlutoGridStateManager stateManager,
})
override

Implement actions to be mapped to shortcut keys.

Implementation

@override
void execute({
  required PlutoKeyManagerEvent keyEvent,
  required PlutoGridStateManager stateManager,
}) {
  if (direction.horizontal) return;

  final int moveCount =
      (stateManager.rowContainerHeight / stateManager.rowTotalHeight).floor();

  int rowIdx = stateManager.currentSelectingPosition?.rowIdx ??
      stateManager.currentCellPosition?.rowIdx ??
      0;

  rowIdx += direction.isUp ? -moveCount : moveCount;

  stateManager.moveSelectingCellByRowIdx(rowIdx, direction);
}