ZwapInfiniteScroll<T> constructor
ZwapInfiniteScroll<T> ({
- Key? key,
- required Future<
PageData< fetchMoreData(T> >- int pageNumber
- required Widget getChildWidget(
- T element
- required ZwapInfiniteScrollType zwapInfiniteScrollType,
- double? mainSizeDirection,
- Axis? axisDirection = Axis.vertical,
- bool hasToReloadOnDidUpdate = false,
- PageData<
T> ? initData, - double? crossSizeDirection,
- Widget? waitingWidget,
- Widget topWidget(
- PageData<
T> elements
- PageData<
- ScrollController? scrollController,
- EdgeInsets? customInternalPadding,
- bool expand = false,
- int? rowWidgetsCount,
- Duration fetchDelayDuration = const Duration(milliseconds: 300),
- Duration noDataDuration = const Duration(milliseconds: 1000),
- bool filter(
- T element
Implementation
ZwapInfiniteScroll({
Key? key,
required this.fetchMoreData,
required this.getChildWidget,
required this.zwapInfiniteScrollType,
this.mainSizeDirection,
this.axisDirection = Axis.vertical,
this.hasToReloadOnDidUpdate = false,
this.initData,
this.crossSizeDirection,
this.waitingWidget,
this.topWidget,
this.scrollController,
this.customInternalPadding,
this.expand = false,
this.rowWidgetsCount,
this.fetchDelayDuration = const Duration(milliseconds: 300),
this.noDataDuration = const Duration(milliseconds: 1000),
this.filter,
}) : assert((!expand || zwapInfiniteScrollType == ZwapInfiniteScrollType.listView) || rowWidgetsCount != null,
"If expand is true and zwapInfinityScrollType is gridView, rowWidgetsCount must be provided"),
super(key: key) {
if (this.zwapInfiniteScrollType == ZwapInfiniteScrollType.gridView) {
assert(this.axisDirection == Axis.vertical, "On grid view infinite scroll the axis direction must be vertical");
}
}