PaginatedListView<T, S extends PaginatedState<T> > class
A reusable paginated list widget that can be used with any data type
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PaginatedListView
Constructors
-
PaginatedListView({Key? key, required ProviderListenable<
S> provider, required Widget itemBuilder(BuildContext context, T item, int index), required Future<void> onLoad(), required Future<void> onLoadMore(String nextPageToken), required Future<void> onRefresh(), Widget? loadingWidget, Widget errorWidget(String error, VoidCallback retry)?, Widget? emptyWidget, double scrollThreshold = 0.8, EdgeInsetsGeometry padding = const EdgeInsets.only(top: 12), List<Widget> topWidgets = const [], List<Widget> bottomWidgets = const [], Widget? loadingMoreWidget, bool showLoadingMoreIndicator = true, ScrollController? scrollController, ScrollPhysics? physics, bool reverse = false, bool shrinkWrap = false, Key? refreshIndicatorKey, Widget separatorBuilder(BuildContext context, int index)?, bool useSeparatedListView = false}) -
const
Properties
-
bottomWidgets
→ List<
Widget> -
Additional widgets to place at the bottom of the list
final
- emptyWidget → Widget?
-
Widget to show when the list is empty
final
- errorWidget → Widget Function(String error, VoidCallback retry)?
-
Widget to show when there's an error
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemBuilder → Widget Function(BuildContext context, T item, int index)
-
Function to build each item in the list
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingMoreWidget → Widget?
-
Widget to show when loading more
final
- loadingWidget → Widget?
-
Loading widget to show when initially loading
final
-
onLoad
→ Future<
void> Function() -
Function to load initial data
final
-
onLoadMore
→ Future<
void> Function(String nextPageToken) -
Function to load more data with the next page token
final
-
onRefresh
→ Future<
void> Function() -
Function to refresh the list
final
- padding → EdgeInsetsGeometry
-
Padding for the list
final
- physics → ScrollPhysics?
-
Physics for the list
final
-
provider
→ ProviderListenable<
S> -
The provider that contains the paginated state
final
- refreshIndicatorKey → Key?
-
Key for the refresh indicator
final
- reverse → bool
-
Whether to reverse the list
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
Scroll controller for the list
final
- scrollThreshold → double
-
Threshold percentage to trigger loading more (0.0 - 1.0)
final
- separatorBuilder → Widget Function(BuildContext context, int index)?
-
Custom separator builder for list items
final
- showLoadingMoreIndicator → bool
-
Whether to show the loading more indicator
final
- shrinkWrap → bool
-
Whether to shrink wrap the list
final
-
topWidgets
→ List<
Widget> -
Additional widgets to place at the top of the list
final
- useSeparatedListView → bool
-
Whether to use a separated list view
final
Methods
-
createElement(
) → ConsumerStatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → ConsumerState< PaginatedListView< T, S> > - Creates the mutable state for this widget at a given location in the tree.
-
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