Paginator<T> class
Paginator has 3 constructors Paginator.listView, Paginator.gridView, Paginator.pageView Paginator.listView, Paginator.gridView and Paginator.pageView are descendants of ListView, GridView and PageView. Paginator.listView, Paginator.gridView and Paginator.pageView got all the features of their ancestors and they are need to provide additional properties that are essential in doing their task.
- Loads the page asynchronously when the page number is given.
- This should return an instance of a Future.
- Called when the next page is needed to be loaded.
- This function should return list of page item data when page data is given.
- This is called after successful completion of pageLoadFuture.
- The page items returned by this method is added to the list of all the page items.
- Builds list item when item data and item index are given.
- This should return an instance of a Widget.
- Builds loading widget.
- This should return an instance of a Widget.
- Builds error widget when page data and error callback are given.
- This should return an instance of a Widget.
- Builds empty list widget.
- This is displayed when the total number of list items is zero.
- This should return an instance of a Widget.
- This should return total number of list items when page data is given.
- This should return true if page has error else false, when page data is given.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Paginator
Constructors
-
Paginator.gridView({Key? key, required PageLoadFuture<
T> pageLoadFuture, required PageItemsGetter<T> pageItemsGetter, required ListItemBuilder listItemBuilder, required LoadingWidgetBuilder loadingWidgetBuilder, required ErrorWidgetBuilder<T> errorWidgetBuilder, required EmptyListWidgetBuilder<T> emptyListWidgetBuilder, required TotalItemsGetter<T> totalItemsGetter, required PageErrorChecker<T> pageErrorChecker, required SliverGridDelegate? gridDelegate, Key? scrollViewKey, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollPhysics? scrollPhysics, EdgeInsets? padding, bool shrinkWrap = false, ScrollController? scrollController, bool? primary, int? semanticChildCount, double? cacheExtent, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true}) -
const
-
Paginator.listView({Key? key, required PageLoadFuture<
T> pageLoadFuture, required PageItemsGetter<T> pageItemsGetter, required ListItemBuilder listItemBuilder, required LoadingWidgetBuilder loadingWidgetBuilder, required ErrorWidgetBuilder<T> errorWidgetBuilder, required EmptyListWidgetBuilder<T> emptyListWidgetBuilder, required TotalItemsGetter<T> totalItemsGetter, required PageErrorChecker<T> pageErrorChecker, Key? scrollViewKey, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollPhysics? scrollPhysics, EdgeInsets? padding, bool shrinkWrap = false, ScrollController? scrollController, bool? primary, int? semanticChildCount, double? cacheExtent, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? itemExtent}) -
const
-
Paginator.pageView({Key? key, required PageLoadFuture<
T> pageLoadFuture, required PageItemsGetter<T> pageItemsGetter, required ListItemBuilder listItemBuilder, required LoadingWidgetBuilder loadingWidgetBuilder, required ErrorWidgetBuilder<T> errorWidgetBuilder, required EmptyListWidgetBuilder<T> emptyListWidgetBuilder, required TotalItemsGetter<T> totalItemsGetter, required PageErrorChecker<T> pageErrorChecker, Key? scrollViewKey, Axis scrollDirection = Axis.horizontal, bool reverse = false, ScrollPhysics? scrollPhysics, ValueChanged<int> ? onPageChanged, bool pageSnapping = true, PageController? pageController}) -
const
Properties
- addAutomaticKeepAlives → bool
-
final
- addRepaintBoundaries → bool
-
final
- addSemanticIndexes → bool
-
final
- cacheExtent → double?
-
final
-
emptyListWidgetBuilder
→ EmptyListWidgetBuilder<
T> -
final
-
errorWidgetBuilder
→ ErrorWidgetBuilder<
T> -
final
- gridDelegate → SliverGridDelegate?
-
properties - grid view only
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemExtent → double?
-
properties - list view only
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listItemBuilder → ListItemBuilder
-
final
- listType → ListType
-
final
- loadingWidgetBuilder → LoadingWidgetBuilder
-
final
-
onPageChanged
→ ValueChanged<
int> ? -
properties - page view only
final
- padding → EdgeInsets?
-
properties - list view, grid view
final
- pageController → PageController?
-
final
-
pageErrorChecker
→ PageErrorChecker<
T> -
final
-
pageItemsGetter
→ PageItemsGetter<
T> -
final
-
pageLoadFuture
→ PageLoadFuture<
T> -
final
- pageSnapping → bool
-
final
- primary → bool?
-
final
- reverse → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
final
- scrollDirection → Axis
-
final
- scrollPhysics → ScrollPhysics?
-
final
- scrollViewKey → Key?
-
common properties
final
- semanticChildCount → int?
-
final
- shrinkWrap → bool
-
final
-
totalItemsGetter
→ TotalItemsGetter<
T> -
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StatefulWidget> -
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}) → 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