itemBuilder property

ItemBuilder<T> itemBuilder
final

Called to build each entry in the view.

It is called for each of the entries fetched by pageFuture and provided with the BuildContext and the entry. It is expected to return the widget that we want to display for each entry

For example, the pageFuture might return a list that looks like:

[
 {
   'name': 'product1',
   'price': 10
 },
 {
   'name': 'product2',
   'price': 15
 },
]

Then itemBuilder will be called twice, once for each entry. We can for example do:

(BuildContext context, dynamic entry) {
  return Text(entry['name'] + ' - ' + entry['price']);
}

Implementation

final ItemBuilder<T> itemBuilder;