getDirectionalIncrement static method

double getDirectionalIncrement(
  1. ScrollableState state,
  2. ScrollIntent intent
)

Find out how much of an increment to move by, taking the different directions into account.

Implementation

static double getDirectionalIncrement(ScrollableState state, ScrollIntent intent) {
  if (axisDirectionToAxis(intent.direction) == axisDirectionToAxis(state.axisDirection)) {
    final double increment = _calculateScrollIncrement(state, type: intent.type);
    return intent.direction == state.axisDirection ? increment : -increment;
  }
  return 0.0;
}