getMinChildIndexForScrollOffset method

  1. @override
int getMinChildIndexForScrollOffset(
  1. double scrollOffset,
  2. double itemExtent
)
override

The minimum child index that is visible at the given scroll offset.

This function uses the returned value of itemExtentBuilder or the itemExtent to avoid recomputing item size repeatedly during layout.

By default, returns a value consistent with the children being placed in order, without gaps, starting from layout offset zero.

Implementation

@override
int getMinChildIndexForScrollOffset(double scrollOffset, double itemExtent) {
  // itemExtent is deprecated in the super class, we ignore it because we use
  // the builder anyways.
  return _getChildIndexForScrollOffset(scrollOffset);
}