ListWheelChildListDelegate class

A delegate that supplies children for ListWheelScrollView using an explicit list.

ListWheelScrollView lazily constructs its children to avoid creating more children than are visible through the Viewport. This delegate provides children using an explicit list, which is convenient but reduces the benefit of building children lazily.

In general building all the widgets in advance is not efficient. It is better to create a delegate that builds them on demand using ListWheelChildBuilderDelegate or by subclassing ListWheelChildDelegate directly.

This class is provided for the cases where either the list of children is known well in advance (ideally the children are themselves compile-time constants, for example), and therefore will not be built each time the delegate itself is created, or the list is small, such that it's likely always visible (and thus there is nothing to be gained by building it on demand). For example, the body of a dialog box might fit both of these conditions.

Inheritance

Constructors

ListWheelChildListDelegate({required List<Widget> children})
Constructs the delegate from a concrete list of children.

Properties

children List<Widget>
The list containing all children that can be supplied.
final
estimatedChildCount int
Returns an estimate of the number of children this delegate will build.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context, int index) Widget?
Return the child at the given index. If the child at the given index does not exist, return null.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRebuild(covariant ListWheelChildListDelegate oldDelegate) bool
Called to check whether this and the old delegate are actually 'different', so that the caller can decide to rebuild or not.
override
toString() String
A string representation of this object.
inherited
trueIndexOf(int index) int
Returns the true index for a child built at a given index. Defaults to the given index, however if the delegate is ListWheelChildLoopingListDelegate, this value is the index of the true element that the delegate is looping to.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited