- override
Returns a widget representing the item with the given index.
This function might be called with index parameters in any order. This function should return null for indices that exceed the number of children provided by this delegate. If this function must not return a null value for an index if it previously returned a non-null value for that index or a larger index.
This function might be called during the build or layout phases of the pipeline.
The returned widget might or might not be cached by LazyBlock
. See
shouldRebuild
for details about how to evict the cache.
Source
@override Widget buildItem(BuildContext context, int index) { assert(index >= 0); return index < children.length ? children[index] : null; }