scrollProgressY property

double get scrollProgressY

Vertical scroll progress as a value between 0.0 and 1.0.

Returns 0.0 if there's no vertical overflow.

Implementation

double get scrollProgressY {
  final scrollMax = max(0.0, contentSize.height - viewportSize.height);
  if (scrollMax == 0.0) {
    return 0.0;
  }
  return vertical.pixels / scrollMax;
}
set scrollProgressY (double value)

Sets the vertical scroll progress (0.0 to 1.0) instantly.

Implementation

set scrollProgressY(double value) {
  final scrollMax = max(0.0, contentSize.height - viewportSize.height);
  vertical.jumpTo(value * scrollMax);
}