estimateMaxScrollOffset method

  1. @override
double estimateMaxScrollOffset(
  1. SliverConstraints? constraints,
  2. int firstIndex,
  3. int lastIndex,
  4. double leadingScrollOffset,
  5. double trailingScrollOffset
)
override

Returns an estimate of the max scroll extent for all the children.

Subclasses should override this function if they have additional information about their max scroll extent.

This is used by SliverMultiBoxAdaptorElement to implement part of the RenderSliverBoxChildManager API.

The default implementation defers to delegate via its SliverChildDelegate.estimateMaxScrollOffset method.

Implementation

@override
double estimateMaxScrollOffset(
  SliverConstraints? constraints,
  int firstIndex,
  int lastIndex,
  double leadingScrollOffset,
  double trailingScrollOffset,
) {
  return super.estimateMaxScrollOffset(
    constraints,
    firstIndex,
    lastIndex,
    leadingScrollOffset,
    trailingScrollOffset,
  ) ?? gridDelegate.getLayout(constraints!).computeMaxScrollOffset(delegate.estimatedChildCount!);
}