Convert a position or velocity measured in terms of pixels to a scrollOffset. Scrollable gesture handlers convert their incoming values with this method. Subclasses that define scrollOffset in units other than pixels must override this method.
This function should be the inverse of scrollOffsetToPixelOffset.
Source
double pixelOffsetToScrollOffset(double pixelOffset) { switch (config.scrollAnchor) { case ViewportAnchor.start: // We negate the delta here because a positive scroll offset moves the // the content up (or to the left) rather than down (or the right). return -pixelOffset; case ViewportAnchor.end: return pixelOffset; } assert(config.scrollAnchor != null); return null; }