ScrollAdapter constructor
ScrollAdapter(
- ScrollController scrollController, {
- double? begin,
- double? end,
- 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);