getTrackToScroll method Null safety

double getTrackToScroll(
  1. 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 = _trackExtent - _thumbExtent();

  return scrollableExtent * thumbOffsetLocal / thumbMovableExtent;
}