getTrackToScroll method Null safety
- double thumbOffsetLocal
Convert between a thumb track position and the corresponding scroll position.
thumbOffsetLocal is a position in the thumb track. Cannot be null.
Implementation
double getTrackToScroll(double thumbOffsetLocal) {
assert(thumbOffsetLocal != null);
final double scrollableExtent = _lastMetrics!.maxScrollExtent - _lastMetrics!.minScrollExtent;
final double thumbMovableExtent = _traversableTrackExtent - _thumbExtent();
return scrollableExtent * thumbOffsetLocal / thumbMovableExtent;
}