estimateMaxScrollOffset method

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

Called to estimate the total scrollable extents of this object.

Must return the total distance from the start of the child with the earliest possible index to the end of the child with the last possible index.

Implementation

@override
double estimateMaxScrollOffset(
  SliverConstraints? constraints, {
  int? firstIndex,
  int? lastIndex,
  double? leadingScrollOffset,
  double? trailingScrollOffset,
}) {
  final int? childCount = estimatedChildCount;
  if (childCount == null) {
    return double.infinity;
  }
  return (widget as SliverMultiBoxAdaptorWidget).estimateMaxScrollOffset(
    constraints,
    firstIndex!,
    lastIndex!,
    leadingScrollOffset!,
    trailingScrollOffset!,
  ) ?? _extrapolateMaxScrollOffset(
    firstIndex,
    lastIndex,
    leadingScrollOffset,
    trailingScrollOffset,
    childCount,
  );
}