PagingWidget<Q, D, B extends BasePagingBloc<Q, D>> class

Inheritance

Constructors

PagingWidget({Key? key, required Widget itemBuilder(BuildContext context, int index, D data), bool needQueryImmediately = true, Q? queryData, int limit = defaultLimitPaging, bool queryConditions(Q)?, List<int> insertedWidgetPositions = const [], Widget loadingItemBuilder(BuildContext context, int index)?, Widget itemDividerBuilder(BuildContext context, int index)?, Widget searchBarBuilder(BuildContext context, void onChangedQuery(Q)?)?, Widget insertedWidgetBuilder(BuildContext context, int index)?, Widget? emptyDataWidget, Widget errorWidgetBuilder(BuildContext context, KntException exception)?, ScrollPhysics? scrollPhysics, int loadingItemCount = _defaultLoadingItemCount, bool gridView = false, SliverGridDelegate? sliverGridDelegate, Axis direction = Axis.vertical, EdgeInsets? padding, double ratioScrollOffsetToLoadMore = _defaultRatioScrollOffsetToLoadMore, void onPickedItem(D item)?, void onItemChanged(PagingDataAction action, int index, D item)?, bool needPaging = true, bool needPullToRefresh = true, bool needShrinkWrap = false})
const

Properties

direction Axis
Scroll direction.
final
emptyDataWidget Widget?
Widget presents empty result.
final
errorWidgetBuilder → (Widget Function(BuildContext context, KntException exception)?)
Builder for error widget, which presents error result.
final
gridView bool
Should using GridView or not, set true if using.
final
hashCode int
The hash code for this object.
no setterinherited
insertedWidgetBuilder → (Widget Function(BuildContext context, int index)?)
Builder for other widgets which we want to insert into list, in case insertedWidgetPositions is not empty.
final
insertedWidgetPositions List<int>
When we want insert other widgets into list in specific positions, using this.
final
itemBuilder Widget Function(BuildContext context, int index, D data)
Builder for items in list.
final
itemDividerBuilder → (Widget Function(BuildContext context, int index)?)
Builder for divider between items.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
limit int
Query limit.
final
loadingItemBuilder → (Widget Function(BuildContext context, int index)?)
Using this builder to build loading items in case loadingItemCount > 0.
final
loadingItemCount int
Total loading items.
final
needPaging bool
Whether need querying paging or not.
final
needPullToRefresh bool
Whether need pull to refresh or not.
final
needQueryImmediately bool
Whether query data immediately.
final
needShrinkWrap bool
Whether need shrink content to fit inside a column or not.
final
onItemChanged → (void Function(PagingDataAction action, int index, D item)?)
Callback will be triggered once BasePagingBloc completed soft-updating on item at index.
final
onPickedItem → (void Function(D item)?)
Callback while users tap on item.
final
padding EdgeInsets?
Padding insets.
final
queryConditions → (bool Function(Q)?)
For filter/search condition before triggering query.
final
queryData → Q?
Query data for each paging request, such as searched keywords.
final
ratioScrollOffsetToLoadMore double
Bouncing offset to trigger loading more, calculate by this ratio * height (Axis.vertical) or ratio * width (Axis.horizontal). Negative value if we want to load data before users scroll to the end of content.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollPhysics ScrollPhysics?
Scroll physic, default is AlwaysScrollableScrollPhysics.
final
searchBarBuilder → (Widget Function(BuildContext context, void onChangedQuery(Q)?)?)
Builder for search widget, if we need search/filter function.
final
sliverGridDelegate SliverGridDelegate?
Only works if gridView = true.
final

Methods

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