SliverInfiniteList class
The sliver version of InfiniteList.
As a infinite list, it is supposed to be the last sliver in the current ScrollView. Otherwise, re-fetching data will have an unintuitive behavior.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SliverInfiniteList
Constructors
- SliverInfiniteList({required int itemCount, required VoidCallback onFetchData, required ItemBuilder itemBuilder, Key? key, Duration debounceDuration = defaultDebounceDuration, bool isLoading = false, bool hasError = false, bool hasReachedMax = false, bool centerLoading = false, bool centerError = false, bool centerEmpty = false, WidgetBuilder? loadingBuilder, WidgetBuilder? errorBuilder, IndexedWidgetBuilder? separatorBuilder, WidgetBuilder? emptyBuilder})
-
Constructs a SliverInfiniteList.
const
Properties
- centerEmpty → bool
-
Indicates if the emptyBuilder should be centered.
final
- centerError → bool
-
Indicates if the errorBuilder should be centered.
final
- centerLoading → bool
-
Indicates if the loadingBuilder should be centered.
final
- debounceDuration → Duration
-
The duration with which calls to onFetchData will be debounced.
final
- emptyBuilder → WidgetBuilder?
-
An optional builder that's shown when the list of items is empty.
final
- errorBuilder → WidgetBuilder?
-
final
- hasError → bool
-
Indicates if an error has occurred.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasReachedMax → bool
-
Indicates if the end of the data source has been reached and no more
data can be fetched.
final
- isLoading → bool
-
Indicates if new items are currently being loaded.
final
- itemBuilder → ItemBuilder
-
The builder used to build a widget for every index of the
itemCount
.final - itemCount → int
-
The amount of items that need to be rendered by the itemBuilder.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingBuilder → WidgetBuilder?
-
An optional builder that's shown at the end of the list when isLoading
is
true
.final - onFetchData → VoidCallback
-
The callback method that's called whenever the list is scrolled to the end
(meaning the top when
reverse
istrue
, or the bottom otherwise).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separatorBuilder → IndexedWidgetBuilder?
-
An optional builder that, when provided, is used to show a widget in
between every pair of items.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SliverInfiniteList> -
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