SliverGroupedListView<T, E> constructor

const SliverGroupedListView<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. Widget separator = const SizedBox.shrink(),
  13. Widget? footer,
})

Implementation

const SliverGroupedListView({
  super.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.separator = const SizedBox.shrink(),
  this.footer,
})  : assert(itemBuilder != null || indexedItemBuilder != null),
      assert(groupSeparatorBuilder != null || groupHeaderBuilder != null);