CustomPaginatedGridView<T> class

A customizable grid view with pagination capabilities.

This widget displays items in a grid and automatically handles loading more items when the user scrolls to the bottom. It also supports pull-to-refresh.

Type parameter T is the type of the data items in the grid, although it's not directly used in the properties of this class, it's passed to the _CustomPaginatedGridViewState to maintain type consistency.

Inheritance

Constructors

CustomPaginatedGridView({Key? key, required Widget itemBuilder(BuildContext, int), required int? itemCount, int? crossAxisCount, bool load = false, ScrollPhysics? physics, String? noDataText, double? noDataHeight, Color? noDataColor, VoidCallback? onMaxScrollExtent, bool isLastPage = false, bool wantLoadMore = true, EdgeInsets? padding, Future<void> onRefresh()?, Future<void> onLoadMore()?})
CustomPaginatedGridView constructor.
const

Properties

crossAxisCount int?
The number of columns in the grid. Defaults to 2.
final
hashCode int
The hash code for this object.
no setterinherited
isLastPage bool
A flag to indicate if the last page of data has been loaded. If true, the onLoadMore callback will not be triggered.
final
itemBuilder Widget Function(BuildContext, int)
A builder function that creates the widget for each item in the grid.
final
itemCount int?
The total number of items in the grid.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
load bool
If true, a loading indicator is shown instead of the grid.
final
noDataColor Color?
The color of the noDataText.
final
noDataHeight double?
The height of the container shown when there is no data. Defaults to a calculated screen height.
final
noDataText String?
The text to display when there is no data to show.
final
onLoadMore Future<void> Function()?
A callback function that is triggered to load more data when the user reaches the end of the list.
final
onMaxScrollExtent VoidCallback?
A callback that is triggered when the user scrolls to the maximum scroll extent.
final
onRefresh Future<void> Function()?
A callback function that is triggered on a pull-to-refresh gesture.
final
padding EdgeInsets?
The padding around the grid view.
final
physics ScrollPhysics?
The physics of the scroll view.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
wantLoadMore bool
A flag to enable or disable the "load more" functionality. Defaults to true.
final

Methods

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