GroupedInfiniteList<T, G> class

Grouped Infinite List

This widget use two SliverList to make infinite list on both side (scroll up and down) possible with positive items list as the center list.

Inheritance

Constructors

GroupedInfiniteList({Key? key, required List<T> positiveItems, required Widget itemBuilder(BuildContext context, T item), required G groupBy(T item), required Widget groupSeparatorBuilder(T item), EdgeInsetsGeometry? groupSeparatorPadding, List<T> negativeItems = const [], Widget separator = const SizedBox.shrink(), ScrollController? controller, Widget? suffix, Widget? negativeSuffix, bool reverse = false, int groupComparator(G value1, G value2)?, int itemComparator(T item1, T item2)?, double anchor = 0.0, double? cacheExtent, Clip clipBehavior = Clip.hardEdge, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, ScrollPhysics? physics, bool? primary, String? restorationId, ScrollBehavior? scrollBehavior, Axis scrollDirection = Axis.vertical, bool addAutomaticKeepAlives = true, bool sort = true, bool useStickyGroupSeparators = false, double stickyHeaderPositionOffset = 0.0})
Grouped Infinite List
const

Properties

addAutomaticKeepAlives bool
Whether to wrap each child in an AutomaticKeepAlive.
final
anchor double
The relative position of the zero scroll offset.
final
cacheExtent double?
The viewport has an area before and after the visible area to cache items that are about to become visible when the user scrolls.
final
clipBehavior Clip
The content will be clipped (or not) according to this option.
final
controller ScrollController?
An object that can be used to control the position to which this scroll view is scrolled.
final
dragStartBehavior DragStartBehavior
Determines the way that drag start behavior is handled.
final
groupBy → G Function(T item)
Define how to group item
final
groupComparator → (int Function(G value1, G value2)?)
Can be used to define a custom sorting for the groups.
final
groupSeparatorBuilder Widget Function(T item)
Group separator builder
final
groupSeparatorPadding EdgeInsetsGeometry
Group separator padding
final
hashCode int
The hash code for this object.
no setterinherited
itemBuilder Widget Function(BuildContext context, T item)
Item builder for SliverChildBuilderDelegate
final
itemComparator → (int Function(T item1, T item2)?)
Can be used to define a custom sorting for the elements inside each group.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardDismissBehavior ScrollViewKeyboardDismissBehavior
ScrollViewKeyboardDismissBehavior the defines how this ScrollView will dismiss the keyboard automatically.
final
negativeItems List<T>
List of negative items
final
negativeSuffix Widget?
Negative suffix Widget, mostly used for list loading indicator
final
physics ScrollPhysics?
How the scroll view should respond to user input.
final
positiveItems List<T>
List of items
final
primary bool?
Whether this is the primary scroll view associated with the parent PrimaryScrollController.
final
restorationId String?
Restoration ID to save and restore the scroll offset of the scrollable.
final
reverse bool
Whether the scroll view scrolls in the reading direction.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollBehavior ScrollBehavior?
A ScrollBehavior that will be applied to this widget individually.
final
scrollDirection Axis
The Axis along which the scroll view's offset increases.
final
separator Widget
Separator
final
sort bool
Whether the items will be sorted or not. If not it must be done manually.
final
stickyHeaderPositionOffset double
Used to calculate sticky header position offset
final
suffix Widget?
Suffix Widget, mostly used for list loading indicator
final
useStickyGroupSeparators bool
When set to true the group header of the current visible group will stick on top.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<GroupedInfiniteList<T, G>>
Creates the mutable state for this widget at a given location in the tree.
override
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