LoadMore class
A widget that provides "load more" functionality for scrollable widgets.
It detects when the user scrolls to the bottom and triggers the onLoadMore callback.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LoadMore
Constructors
- LoadMore({Key? key, required Widget child, required FutureCallBack onLoadMore, LoadMoreTextBuilder? textBuilder, bool isFinish = false, LoadMoreDelegate? delegate, bool whenEmptyLoad = true})
-
Creates an instance of LoadMore.
const
Properties
- child → Widget
-
The scrollable widget (e.g., ListView, SliverList) to wrap.
final
- delegate → LoadMoreDelegate?
-
Delegate to customize the load more UI.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isFinish → bool
-
Whether there is no more data to load.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onLoadMore → FutureCallBack
-
Callback function to load more data. Returns true if successful.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textBuilder → LoadMoreTextBuilder?
-
Text builder to customize the text displayed in different states.
final
- whenEmptyLoad → bool
-
Whether to trigger load more when the list is empty.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _LoadMoreState -
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
Static Properties
-
buildDelegate
↔ DelegateBuilder<
LoadMoreDelegate> -
Builder for the delegate that controls the load more UI.
getter/setter pair
-
buildTextBuilder
↔ DelegateBuilder<
LoadMoreTextBuilder> -
Builder for the text builder used in the default delegate.
getter/setter pair