ApiInfiniteList<ResponseObj, RepetedDate> class

A StatefulWidget that handles infinite scrolling lists with API pagination.

It manages the loading, success, error, and empty states of the list. It automatically loads more data when the user scrolls to the bottom.

Inheritance

Constructors

ApiInfiniteList({Key? key, required Future<ResponseObj> requestFunction(int pageNumber, int pageSize), HDMHttpRequestsStates<List<RepetedDate>>? httpRequestsStates, required Widget listViewBuilder(BuildContext context, List<RepetedDate> items), required bool isFinished(List<RepetedDate> response), int initialPageNumber = 1, int pageSize = 20, required List<RepetedDate> extractTheLIst(ResponseObj responseObj), ResponseObj? fakeData})
Creates an instance of ApiInfiniteList.

Properties

data List<RepetedDate>
The list of data items loaded so far.
final
extractTheLIst List<RepetedDate> Function(ResponseObj responseObj)
Function to extract the list of items from the API response.
final
fakeData → ResponseObj?
Fake data to be used for skeleton loading.
final
hashCode int
The hash code for this object.
no setterinherited
httpRequestsStates HDMHttpRequestsStates<List<RepetedDate>>?
State management for HTTP requests.
final
initialPageNumber int
The initial page number to start loading from. Default is 1.
final
isFinished bool Function(List<RepetedDate> response)
Function to check if there is no more data to load.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listViewBuilder Widget Function(BuildContext context, List<RepetedDate> items)
Builder function for the list view.
final
pageSize int
The number of items per page. Default is 20.
final
requestFunction Future<ResponseObj> Function(int pageNumber, int pageSize)
Function to make the API request for a specific page.
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() → _ApiInfiniteListState<ResponseObj, RepetedDate>
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