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
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ApiInfiniteList
Constructors
-
ApiInfiniteList({Key? key, required Future<
ResponseObj> requestFunction(int pageNumber, int pageSize), HDMHttpRequestsStates<List< ? httpRequestsStates, required Widget listViewBuilder(BuildContext context, List<RepetedDate> >RepetedDate> items), required bool isFinished(List<RepetedDate> response), int initialPageNumber = 1, int pageSize = 20, required List<RepetedDate> extractTheLIst(ResponseObj responseObj), bool useSkeleton = false, Widget? skeleton}) - 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
- 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
- skeleton → Widget?
-
The skeleton widget to display when loading (if useSkeleton is true).
final
- useSkeleton → bool
-
Whether to use skeleton loading.
final
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