getMaxChildIndexForScrollOffset method

  1. @override
int getMaxChildIndexForScrollOffset (double scrollOffset)
override

The maximum child index that is visible at (or before) this scroll offset.

Implementation

@override
int getMaxChildIndexForScrollOffset(double scrollOffset) {
  if (mainAxisStride > 0.0) {
    final int mainAxisCount = (scrollOffset / mainAxisStride).ceil();
    return math.max(0, crossAxisCount * mainAxisCount - 1);
  }
  return 0;
}