getTrackToScroll method

double getTrackToScroll(
  1. double thumbOffsetLocal
)

Convert between a thumb track position and the corresponding scroll position.

The thumbOffsetLocal argument is a position in the thumb track.

Implementation

double getTrackToScroll(double thumbOffsetLocal) {
  final double scrollableExtent =
      _lastMetrics!.maxScrollExtent - _lastMetrics!.minScrollExtent;
  final double thumbMovableExtent = _traversableTrackExtent - _thumbExtent;

  return scrollableExtent * thumbOffsetLocal / thumbMovableExtent;
}