onIndexChanged property
Called when the list scroll ends and returns the topmost index of the list.
If overlaySlivers or prefix are included, the bottom of those areas at a scroll offset of 0 is considered the top of the list.
crossAxisCount
is the number of children along the horizontal axis in a GridView.
For a ListView, it is 1.
Implementation
final void Function(int index, int crossAxisCount)? onIndexChanged;