getThumbScrollOffset method

double getThumbScrollOffset()

The thumb's corresponding scroll offset in the track.

Implementation

double getThumbScrollOffset() {
  final double scrollableExtent =
      _lastMetrics!.maxScrollExtent - _lastMetrics!.minScrollExtent;

  final double fractionPast = (scrollableExtent > 0)
      ? clampDouble(_lastMetrics!.pixels / scrollableExtent, 0.0, 1.0)
      : 0;

  return fractionPast * (_traversableTrackExtent - _thumbExtent);
}