GroupedListView<T, E> constructor

GroupedListView<T, E>({
  1. Key? key,
  2. required List<T> elements,
  3. required E groupBy(
    1. T element
    ),
  4. int groupComparator(
    1. E value1,
    2. E value2
    )?,
  5. Widget groupSeparatorBuilder(
    1. E value
    )?,
  6. Widget groupHeaderBuilder(
    1. T element
    )?,
  7. Widget itemBuilder(
    1. BuildContext context,
    2. T element
    )?,
  8. Widget indexedItemBuilder(
    1. BuildContext context,
    2. T element,
    3. int index
    )?,
  9. int itemComparator(
    1. T element1,
    2. T element2
    )?,
  10. GroupedListOrder order = GroupedListOrder.ASC,
  11. bool sort = true,
  12. bool useStickyGroupSeparators = false,
  13. Widget separator = const SizedBox.shrink(),
  14. bool floatingHeader = false,
  15. Color stickyHeaderBackgroundColor = const Color(0xffF7F7F7),
  16. Axis scrollDirection = Axis.vertical,
  17. ScrollController? controller,
  18. bool? primary,
  19. ScrollPhysics? physics,
  20. bool shrinkWrap = false,
  21. EdgeInsetsGeometry? padding,
  22. bool reverse = false,
  23. bool addAutomaticKeepAlives = true,
  24. bool addRepaintBoundaries = true,
  25. bool addSemanticIndexes = true,
  26. double? cacheExtent,
  27. Clip clipBehavior = Clip.hardEdge,
  28. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  29. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  30. String? restorationId,
  31. int? semanticChildCount,
  32. double? itemExtent,
})

Creates a GroupedListView

Implementation

GroupedListView({
  Key? key,
  required this.elements,
  required this.groupBy,
  this.groupComparator,
  this.groupSeparatorBuilder,
  this.groupHeaderBuilder,
  this.itemBuilder,
  this.indexedItemBuilder,
  this.itemComparator,
  this.order = GroupedListOrder.ASC,
  this.sort = true,
  this.useStickyGroupSeparators = false,
  this.separator = const SizedBox.shrink(),
  this.floatingHeader = false,
  this.stickyHeaderBackgroundColor = const Color(0xffF7F7F7),
  this.scrollDirection = Axis.vertical,
  this.controller,
  this.primary,
  this.physics,
  this.shrinkWrap = false,
  this.padding,
  this.reverse = false,
  this.addAutomaticKeepAlives = true,
  this.addRepaintBoundaries = true,
  this.addSemanticIndexes = true,
  this.cacheExtent,
  this.clipBehavior = Clip.hardEdge,
  this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  this.dragStartBehavior = DragStartBehavior.start,
  this.restorationId,
  this.semanticChildCount,
  this.itemExtent,
})  : assert(itemBuilder != null || indexedItemBuilder != null),
      assert(groupSeparatorBuilder != null || groupHeaderBuilder != null),
      super(key: key);