SliverGroupedList<Header, Entry> class

A SliverGroupedList list which wraps a CustomScrollView providing created _SliverGroupedHeader and _SliverGroupedEntry slivers

Builder is used to create a list of Widget and set is as a slivers property of CustomScrollView

For every _SliverGroupedHeader and _SliverGroupedEntry a separate builder method is created: bodyHeaderBuilder and bodyEntryBuilder if no entries, bodyPlaceholderBuilder is created

data is based on provided Header and Entry types.

To build a SliverGroupedList the Header and Entry types should be explicitly showed like SliverGroupedList<String, String>

Every item of the sliver list handles onItemTap event providing the tapped item as a parameter.

Inheritance

Constructors

SliverGroupedList({Key? key, required Map<Header, List<Entry>> data, bool bodyHeaderPinned = false, bool bodyHeaderFloating = false, double bodyHeaderMinHeight = _kMinHeightDim, double bodyHeaderMaxHeight = _kMaxHeightDim, required Widget bodyHeaderBuilder(BuildContext context, Header header), required Widget bodyEntryBuilder(BuildContext context, int index, Entry item), required Widget bodyPlaceholderBuilder(BuildContext context, Header header), Widget? appBar, RenderObjectWidget? header, RenderObjectWidget? footer, ScrollController? controller, bool? primary, ScrollPhysics? physics, Key? center, double? cacheExtent, int? semanticChildCount, Axis scrollDirection = Axis.vertical, bool reverse = false, bool shrinkWrap = false, double anchor = 0.0})
const

Properties

anchor double
final
appBar Widget?
appBar provide additional Sliver related widget to display content above header as an app bar.
final
bodyEntryBuilder Widget Function(BuildContext context, int index, Entry item)
bodyEntryBuilder is mandatory and should not be null assertion is used to check the nullability of the property and will show a stacktrace
final
bodyHeaderBuilder Widget Function(BuildContext context, Header header)
bodyHeaderBuilder is mandatory and should not be null assertion is used to check the nullability of the property and will show a stacktrace
final
bodyHeaderFloating bool
Set bodyHeaderFloating to toggle visibility of top header of the first group of elements by default is set to false
final
bodyHeaderMaxHeight double
final
bodyHeaderMinHeight double
Set bodyHeaderMinHeight and bodyHeaderMaxHeight to make collapsable header for entry bodyHeaderMinHeight is 40.0 by default bodyHeaderMaxHeight is 50.0 by default
final
bodyHeaderPinned bool
Set bodyHeaderPinned to pin header and to enable/prevent dismissing by scrolling by default is set to false
final
bodyPlaceholderBuilder Widget Function(BuildContext context, Header header)
bodyPlaceholderBuilder will be used when no elements are available for a certain key
final
cacheExtent double?
final
center Key?
final
controller ScrollController?
final
data Map<Header, List<Entry>>
data is mandatory and should not be null assertion is used to check the nullability of the property and will show a stacktrace
final
dragStartBehavior DragStartBehavior
final
footer provide additional Sliver related widget to display content under body.
final
hashCode int
The hash code for this object.
no setterinherited
header provide additional Sliver related widget to display content above body.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
physics ScrollPhysics?
final
primary bool?
final
reverse bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollDirection Axis
Properties of CustomScrollView
final
semanticChildCount int?
final
shrinkWrap bool
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