GroupedListView<K, V extends Iterable> constructor
GroupedListView<K, V extends Iterable> ({
- Key? key,
- required Map<
K, V> groupedItems, - Axis scrollDirection = Axis.vertical,
- bool reverse = false,
- ScrollController? controller,
- bool? primary,
- ScrollPhysics? physics,
- bool shrinkWrap = false,
- EdgeInsetsGeometry? padding,
- required GroupedListViewWidgetBuilder itemBuilder,
- required GroupedListViewWidgetBuilder groupBuilder,
- required GroupedListViewWidgetBuilder separatorBuilder,
- bool addAutomaticKeepAlives = true,
- bool addRepaintBoundaries = true,
- bool addSemanticIndexes = true,
- double? cacheExtent,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
- String? restorationId,
- Clip clipBehavior = Clip.hardEdge,
- bool preCalculatedGroupedItemInfo = true,
Implementation
GroupedListView({
Key? key,
required Map<K, V> groupedItems,
this.scrollDirection = Axis.vertical,
this.reverse = false,
this.controller,
this.primary,
this.physics,
this.shrinkWrap = false,
this.padding,
required this.itemBuilder,
required this.groupBuilder,
required this.separatorBuilder,
this.addAutomaticKeepAlives = true,
this.addRepaintBoundaries = true,
this.addSemanticIndexes = true,
this.cacheExtent,
this.dragStartBehavior = DragStartBehavior.start,
this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
this.restorationId,
this.clipBehavior = Clip.hardEdge,
bool preCalculatedGroupedItemInfo = true,
}) : super(key: key) {
itemCount = groupedItems.entries.length +
groupedItems.entries.map((e) => e.value.length).reduce((value, element) => value + element);
this.items = groupedItems;
if (preCalculatedGroupedItemInfo) {
final calculatedGroupItemInfos = _calculateGroupItemInfos();
itemInfoProvider = (index) => calculatedGroupItemInfos[index];
} else {
itemInfoProvider = _getGroupedItemInfo;
}
}