ItemBuilder<T> class

A delegate that builds items on demand using a builder function.

Allows lazy generation of items, useful for large or infinite lists.

Example:

ItemBuilder<int>(
  itemCount: 100,
  itemBuilder: (index) => index * 2,
)
Inheritance

Constructors

ItemBuilder({int? itemCount, required T? itemBuilder(int index)})
Creates an ItemBuilder.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
itemBuilder → T? Function(int index)
Builder function that returns an item for the given index.
final
itemCount → int?
The total number of items, or null if infinite.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited
operator [](int index) → T?
Retrieves the item at the specified index.
override