scrollPercent property

double get scrollPercent

Returns the scroll percentage (0.0 to 1.0).

Implementation

double get scrollPercent {
  final (total, _, _) = calculateLine(0);
  final h = _maxHeight();
  if (h >= total || h == 0) return 1.0;
  final y = yOffset.toDouble();
  final t = total.toDouble();
  final v = y / (t - h);
  return v.clamp(0.0, 1.0);
}