updateGeometry method

  1. @override
double updateGeometry ()
override

Updates geometry, and returns the new value for childMainAxisPosition.

This is used by performLayout.

Implementation

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