builder static method
FItemGroup
builder({
- required NullableIndexedWidgetBuilder itemBuilder,
- int? count,
- FItemGroupStyleDelta style = const .context(),
- ScrollController? scrollController,
- ScrollCacheExtent? scrollCacheExtent,
- double maxHeight = .infinity,
- DragStartBehavior dragStartBehavior = .start,
- ScrollPhysics physics = const ClampingScrollPhysics(),
- bool? enabled,
- FItemDivider divider = .none,
- String? semanticsLabel,
- Key? key,
Creates a FItemGroup that lazily builds its children.
The itemBuilder is called for each item that should be built. The current level's FInheritedItemData is not
visible to itemBuilder.
- It may return null to signify the end of the group.
- It may be called more than once for the same index.
- It will be called only for indices <=
countifcountis given.
The count is the number of items to build. If null, itemBuilder will be called until it returns null.
Contract
Throws AssertionError if used in a intrinsic FItemGroup.merge.
Notes
May result in an infinite loop or run out of memory if:
- Placed in a parent widget that does not constrain its size, i.e. Column.
countis null anditemBuilderalways provides a zero-size widget, i.e. SizedBox(). If possible, provide items with non-zero size, return null from builder, or setcountto non-null.
Implementation
static FItemGroup builder({
required NullableIndexedWidgetBuilder itemBuilder,
int? count,
FItemGroupStyleDelta style = const .context(),
ScrollController? scrollController,
ScrollCacheExtent? scrollCacheExtent,
double maxHeight = .infinity,
DragStartBehavior dragStartBehavior = .start,
ScrollPhysics physics = const ClampingScrollPhysics(),
bool? enabled,
FItemDivider divider = .none,
String? semanticsLabel,
Key? key,
}) => .builder(
itemBuilder: itemBuilder,
count: count,
style: style,
scrollController: scrollController,
scrollCacheExtent: scrollCacheExtent,
maxHeight: maxHeight,
dragStartBehavior: dragStartBehavior,
physics: physics,
enabled: enabled,
divider: divider,
semanticsLabel: semanticsLabel,
key: key,
);