applyUserOffset method

  1. @override
void applyUserOffset (
  1. double delta

Updates the scroll position by the given amount.

Appropriate for when the user is directly manipulating the scroll position, for example by dragging the scroll view. Typically applies ScrollPhysics.applyPhysicsToUserOffset and other transformations that are appropriate for user-driving scrolling.


void applyUserOffset(double delta) {
  updateUserScrollDirection(delta > 0.0 ? ScrollDirection.forward : ScrollDirection.reverse);
  setPixels(pixels - physics.applyPhysicsToUserOffset(this, delta));