ListWheelChildLoopingListDelegate class
A delegate that supplies infinite children for ListWheelScrollView by looping 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
- Object
- ListWheelChildDelegate
- ListWheelChildLoopingListDelegate
Constructors
-
ListWheelChildLoopingListDelegate({@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.
read-only, override
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
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
-
shouldRebuild(
covariant ListWheelChildLoopingListDelegate 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
-
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. [...]
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited