estimateMaxScrollOffset method Null safety

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

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

double? estimateMaxScrollOffset(
  SliverConstraints? constraints,
  int firstIndex,
  int lastIndex,
  double leadingScrollOffset,
  double trailingScrollOffset,
) {
  assert(lastIndex >= firstIndex);
  return delegate.estimateMaxScrollOffset(
    firstIndex,
    lastIndex,
    leadingScrollOffset,
    trailingScrollOffset,
  );
}