moveScrollByRow method
Scroll to rowIdx
position.
Implementation
@override
void moveScrollByRow(PlutoMoveDirection direction, int? rowIdx) {
if (!direction.vertical) {
return;
}
final double rowSize = rowTotalHeight;
final double screenOffset = scroll.verticalOffset +
columnRowContainerHeight -
columnGroupHeight -
columnHeight -
columnFilterHeight -
columnFooterHeight -
PlutoGridSettings.rowBorderWidth;
double offsetToMove =
direction.isUp ? (rowIdx! - 1) * rowSize : (rowIdx! + 1) * rowSize;
final bool inScrollStart = scroll.verticalOffset <= offsetToMove;
final bool inScrollEnd = offsetToMove + rowSize <= screenOffset;
if (inScrollStart && inScrollEnd) {
return;
} else if (inScrollEnd == false) {
offsetToMove =
scroll.verticalOffset + offsetToMove + rowSize - screenOffset;
}
scrollByDirection(direction, offsetToMove);
}