paintOffset method

double paintOffset(
  1. double from,
  2. double to
)

Computes the portion of the region from from to to that is visible.

This method is identical to RenderSliver.calculatePaintOffset.

Implementation

double paintOffset(double from, double to) {
  assert(from <= to);
  final minOffset = scrollOffset;
  final maxOffset = scrollOffset + remainingPaintExtent;
  from = from.clamp(minOffset, maxOffset);
  to = to.clamp(minOffset, maxOffset);
  return (to - from).clamp(0.0, remainingPaintExtent);
}