ScrollAdapter constructor

ScrollAdapter(
  1. ScrollController scrollController, {
  2. double? begin,
  3. double? end,
  4. bool? animated,
})

Implementation

ScrollAdapter(ScrollController scrollController,
    {this.begin, this.end, bool? animated})
    : super(scrollController, () {
        ScrollPosition pos = scrollController.position;
        double min = pos.minScrollExtent, max = pos.maxScrollExtent;
        double minPx = _getPx(begin, min, max, min);
        double maxPx = _getPx(end, min, max, max);
        return (pos.pixels - minPx) / (maxPx - minPx);
      }, animated: animated);