SliverPagingList<PageKey, Value> class

A sliver that displays a paginated, linear list of items.

This widget automatically handles loading more data when the user scrolls near the boundaries of the list, using a DataSource. It can display initial loading indicators, prepend/append loading indicators, empty states, and error messages.

For a non-sliver version that wraps this in a CustomScrollView, see PagingList.

Inheritance

Constructors

SliverPagingList({Key? key, required DataSource<PageKey, Value> dataSource, required TypedWidgetBuilder<Value> builder, ExceptionWidgetBuilder? errorBuilder, Widget? initialLoadingWidget, Widget? prependLoadingWidget, Widget? appendLoadingWidget, Widget? emptyWidget, bool fillRemainErrorWidget = true, bool fillRemainEmptyWidget = true, EdgeInsets padding = EdgeInsets.zero, bool autoLoadAppend = true, bool autoLoadPrepend = true})
Creates a scrollable, linear array of widgets that are created on demand.
const
SliverPagingList.separated({Key? key, required DataSource<PageKey, Value> dataSource, required TypedWidgetBuilder<Value> builder, ExceptionWidgetBuilder? errorBuilder, Widget? initialLoadingWidget, Widget? prependLoadingWidget, Widget? appendLoadingWidget, Widget? emptyWidget, bool fillRemainErrorWidget = true, bool fillRemainEmptyWidget = true, EdgeInsets padding = EdgeInsets.zero, required IndexedWidgetBuilder separatorBuilder, bool autoLoadAppend = true, bool autoLoadPrepend = true})
Creates a scrollable linear array of list "items" separated by list item "separators".
const

Properties

appendLoadingWidget Widget?
The widget that is shown when the data is loading at the end of the list.
final
autoLoadAppend bool
Automatically load more data at the end of the list when reaching the boundary.
final
autoLoadPrepend bool
Automatically load more data at the beginning of the list when reaching the boundary.
final
builder TypedWidgetBuilder<Value>
The builder that builds a widget for the given item and index.
final
dataSource DataSource<PageKey, Value>
The DataSource that provides the paginated data.
final
emptyWidget Widget?
The widget that is shown when the data is empty.
final
errorBuilder ExceptionWidgetBuilder?
The builder that builds a widget for the given exception.
final
fillRemainEmptyWidget bool
If true, the empty widget will fill the remaining space of the viewport.
final
fillRemainErrorWidget bool
If true, the error widget will fill the remaining space of the viewport.
final
hashCode int
The hash code for this object.
no setterinherited
initialLoadingWidget Widget?
The widget that is shown when the data is loading for the first time.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
padding EdgeInsets
The padding around the list.
final
prependLoadingWidget Widget?
The widget that is shown when the data is loading at the beginning of the list.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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, int wrapWidth = 65}) 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