updateGeometry method

  1. @protected
double updateGeometry ()
@protected

Updates geometry, and returns the new value for childMainAxisPosition.

This is used by performLayout.

Implementation

@protected
double updateGeometry() {
  final double maxExtent = this.maxExtent;
  final double paintExtent = maxExtent - _effectiveScrollOffset;
  final double layoutExtent = maxExtent - constraints.scrollOffset;
  geometry = SliverGeometry(
    scrollExtent: maxExtent,
    paintOrigin: math.min(constraints.overlap, 0.0),
    paintExtent: paintExtent.clamp(0.0, constraints.remainingPaintExtent),
    layoutExtent: layoutExtent.clamp(0.0, constraints.remainingPaintExtent),
    maxPaintExtent: maxExtent,
    maxScrollObstructionExtent: maxExtent,
    hasVisualOverflow: true, // Conservatively say we do have overflow to avoid complexity.
  );
  return math.min(0.0, paintExtent - childExtent);
}