InfiniteScrollPagination class

A widget that enables effortless infinite scrolling by simply wrapping a scrollable child.

It works out-of-the-box with any primary scrollable widget, automatically detecting the scroll boundary to trigger the onLoadMore callback—no manual ScrollController management is needed.

A loading indicator is displayed while new content is being fetched, and its position is handled automatically based on the reverse property.

Inheritance

Constructors

InfiniteScrollPagination({Key? key, bool isEnabled = true, Widget? loadingIndicator, double preloadOffset = 0.0, bool canBouncing = true, bool reverse = false, required AsyncCallback onLoadMore, required Widget child})
const

Properties

canBouncing bool
Whether the loading indicator should sync with iOS-style bouncing scroll and move along with the overscroll effect.
final
child Widget
The child widget that defines the Scrollable widget.
final
hashCode int
The hash code for this object.
no setterinherited
isEnabled bool
Whether infinite scroll pagination is enabled.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingIndicator Widget?
A widget to display while loading more content (e.g., a loading spinner).
final
onLoadMore AsyncCallback
Called to asynchronously load more content when scrolling approaches the loading boundary.
final
preloadOffset double
The distance from the bottom at which to trigger onLoadMore.
final
reverse bool
Whether the scroll view scrolls in the reverse direction.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<InfiniteScrollPagination>
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, 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