PagingWidget<Q, D, B extends BasePagingBloc<Q, D>> class
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