ZwapInfiniteScroll<T> constructor

ZwapInfiniteScroll<T>({
  1. Key? key,
  2. required Future<PageData<T>> fetchMoreData(
    1. int pageNumber
    ),
  3. required Widget getChildWidget(
    1. T element
    ),
  4. required ZwapInfiniteScrollType zwapInfiniteScrollType,
  5. double? mainSizeDirection,
  6. Axis? axisDirection = Axis.vertical,
  7. bool hasToReloadOnDidUpdate = false,
  8. PageData<T>? initData,
  9. double? crossSizeDirection,
  10. Widget? waitingWidget,
  11. Widget topWidget(
    1. PageData<T> elements
    )?,
  12. ScrollController? scrollController,
  13. EdgeInsets? customInternalPadding,
  14. bool expand = false,
  15. int? rowWidgetsCount,
  16. Duration fetchDelayDuration = const Duration(milliseconds: 300),
  17. Duration noDataDuration = const Duration(milliseconds: 1000),
  18. bool filter(
    1. 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");
  }
}