updateOutOfBandData method

  1. @override
void updateOutOfBandData(
  1. GrowthDirection growthDirection,
  2. SliverGeometry childLayoutGeometry
)
override

Called during layoutChildSequence for each child.

Typically used by subclasses to update any out-of-band data, such as the max scroll extent, for each child.

Implementation

@override
void updateOutOfBandData(GrowthDirection growthDirection, SliverGeometry childLayoutGeometry) {
  switch (growthDirection) {
    case GrowthDirection.forward:
      _maxScrollExtent += childLayoutGeometry.scrollExtent;
    case GrowthDirection.reverse:
      _minScrollExtent -= childLayoutGeometry.scrollExtent;
  }
  if (childLayoutGeometry.hasVisualOverflow) {
    _hasVisualOverflow = true;
  }
}