double pixelDeltaToScrollOffset(Offset pixelDelta)

Returns the scroll offset component of the given pixel delta, accounting for the scroll direction and scroll anchor.

A pixel delta is an Offset in pixels. Typically this function is implemented in terms of pixelOffsetToScrollOffset.

Source

double pixelDeltaToScrollOffset(Offset pixelDelta) {
  switch (config.scrollDirection) {
    case Axis.horizontal:
      return pixelOffsetToScrollOffset(pixelDelta.dx);
    case Axis.vertical:
      return pixelOffsetToScrollOffset(pixelDelta.dy);
  }
  assert(config.scrollDirection != null);
  return null;
}