GroupedListView<H, I> class

GroupedListView Widget The goal of this widget is to take a list of items as an input, group them, and display them, grouped with a header In order to do that, it needs 4 things

  • A list of items
  • A function that groups this list of item given a certain criteria
  • A function that builds a header
  • A function that builds a list of items
Inheritance

Constructors

GroupedListView({Key? key, required List<I> items, HeaderBuilder<H>? headerBuilder, ItemsListBuilder<I>? itemsBuilder, required H itemGrouper(I item), ItemsWithHeaderBuilder<H, I>? customBuilder, Comparator<H>? headerSorter, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? controller, bool? primary, ScrollPhysics? physics, bool shrinkWrap = true, EdgeInsetsGeometry? padding, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, int? semanticChildCount, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, String? restorationId, Clip clipBehavior = Clip.hardEdge, MainAxisAlignment itemsMainAxisAlignment = MainAxisAlignment.start, MainAxisSize itemsMainAxisSize = MainAxisSize.max, CrossAxisAlignment itemsCrossAxisAlignment = CrossAxisAlignment.center, TextDirection? itemsTextDirection, VerticalDirection itemsVerticalDirection = VerticalDirection.down, TextBaseline? itemsTextBaseline})
Created a GroupedListView with all the customized parametes you want
GroupedListView.grid({Key? key, required List<I> items, required HeaderBuilder<H> headerBuilder, required Widget gridItemBuilder(BuildContext context, int itemCountInGroup, int itemIndexInGroup, I item, int itemIndexInOriginalList), required H itemGrouper(I item), Comparator<H>? headerSorter, required int crossAxisCount, double crossAxisSpacing = 0, double mainAxisSpacing = 0, double itemsAspectRatio = 1, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? controller, bool? primary, ScrollPhysics? physics, bool shrinkWrap = true, EdgeInsetsGeometry? padding, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, int? semanticChildCount, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, String? restorationId, Clip clipBehavior = Clip.hardEdge})
Created a GroupedListView with your List of I displayed in a GridView
GroupedListView.list({Key? key, required List<I> items, required HeaderBuilder<H> headerBuilder, required Widget listItemBuilder(BuildContext context, int itemCountInGroup, int itemIndexInGroup, I item, int itemIndexInOriginalList), required H itemGrouper(I item), Comparator<H>? headerSorter, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? controller, bool? primary, ScrollPhysics? physics, bool shrinkWrap = true, EdgeInsetsGeometry? padding, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, int? semanticChildCount, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, String? restorationId, Clip clipBehavior = Clip.hardEdge})
Created a GroupedListView with your List of I displayed in a ListView

Properties

addAutomaticKeepAlives bool
final
addRepaintBoundaries bool
final
addSemanticIndexes bool
final
cacheExtent double?
final
clipBehavior Clip
final
controller ScrollController?
Defines a specific ScrollController for the ListView
final
customBuilder ItemsWithHeaderBuilder<H, I>?
Special Widget builder taking a BuildContext, a H header and a List of I items. This must be null if you pass a headerBuilder and a itemsBuilder parameters.
final
dragStartBehavior DragStartBehavior
final
hashCode int
The hash code for this object.
no setterinherited
headerBuilder HeaderBuilder<H>?
Special Widget builder taking a BuildContext and a H header (H is defined by you in the itemGrouper parameter) This must be null if you pass a customBuilder parameter.
final
headerSorter Comparator<H>?
Optional Function that helps sort the groups by comparing the H headers.
final
itemGrouper → H Function(I item)
Special Function that takes a I and returns a H. This function is used to create the groups of items.
final
items List<I>
List of the items you want to display grouped
final
itemsBuilder ItemsListBuilder<I>?
Special Widget builder taking a BuildContext and a List of I items This must be null if you pass a customBuilder parameter.
final
itemsCrossAxisAlignment CrossAxisAlignment
Only used If you are not using a customBuilder Set the CrossAxisAlignment of the Column used to display the H header and its List of I items By default, it is CrossAxisAlignment.center
final
itemsMainAxisAlignment MainAxisAlignment
Only used If you are not using a customBuilder Set the MainAxisAlignment of the Column used to display the H header and its List of I items By default, it is MainAxisAlignment.start
final
itemsMainAxisSize MainAxisSize
Only used If you are not using a customBuilder Set the MainAxisSize of the Column used to display the H header and its List of I items By default, it is MainAxisSize.max
final
itemsTextBaseline TextBaseline?
Only used If you are not using a customBuilder Set the TextBaseline of the Column used to display the H header and its List of I items
final
itemsTextDirection TextDirection?
Only used If you are not using a customBuilder Set the TextDirection of the Column used to display the H header and its List of I items
final
itemsVerticalDirection VerticalDirection
Only used If you are not using a customBuilder Set the VerticalDirection of the Column used to display the H header and its List of I items
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardDismissBehavior ScrollViewKeyboardDismissBehavior
final
padding EdgeInsetsGeometry?
Defines an optional EdgeInsetsGeometry padding for the ListView
final
physics ScrollPhysics?
Defines a specific ScrollPhysics for the ListView
final
primary bool?
final
restorationId String?
final
reverse bool
Defines if the ListView is reversed or not By default, it is false
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollDirection Axis
Defines the scroll direction of the ListView By default, it is Axis.vertical
final
semanticChildCount int?
final
shrinkWrap bool
Defines if the ListView is shrinked By default, it is true
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited