indexToLayoutOffset method Null safety

  1. @protected
double indexToLayoutOffset(
  1. double itemExtent,
  2. int index
)
protected">@protected

The layout offset for the child with the given index.

This function is given the itemExtent as an argument to avoid recomputing itemExtent repeatedly during layout.

By default, places the children in order, without gaps, starting from layout offset zero.

Implementation

@protected
double indexToLayoutOffset(double itemExtent, int index) => itemExtent * index;