itemBuilder property
To lazily build items on the viewport.
When Loop: false, ItemIndex is equal to RealIndex (i.e, index of element).
When loop: true, two indexes are exposed by item builder.
One is itemIndex
, that is the modded item index i.e., for list of 10, position(11) = 1, and position(-1) = 9.
Other is realIndex
, that is the actual index, i.e. ..., -2, -1, 0, 1, 2, ...
in loop.
Real Index is needed if you want to support JumpToItem by tapping on it.
Implementation
final Widget Function(BuildContext context, int itemIndex, int realIndex)
itemBuilder;