XScrollView<T> constructor

const XScrollView<T>({
  1. required XScrollItemBuilder<T> itemBuilder,
  2. Key? key,
  3. XScrollFetcher<T>? onInit,
  4. XScrollFetcher<T>? onLoadMore,
  5. ValueChanged<List<T>>? onItemsChanged,
  6. XScrollItemTap<T>? onItemTap,
  7. List<T> initialItems = const [],
  8. bool initialHasMore = true,
  9. int pageSize = 20,
  10. bool autoLoad = true,
  11. bool enableRefresh = true,
  12. Axis scrollDirection = Axis.vertical,
  13. double refreshTriggerExtent = 80,
  14. double paginationThreshold = 200,
  15. ScrollController? controller,
  16. EdgeInsetsGeometry? padding,
  17. ScrollPhysics? physics,
  18. SliverGridDelegate? gridDelegate,
  19. IndexedWidgetBuilder? separatorBuilder,
  20. Widget? header,
  21. Widget? footer,
  22. WidgetBuilder? loadingBuilder,
  23. WidgetBuilder? emptyBuilder,
  24. XScrollErrorBuilder? errorBuilder,
  25. WidgetBuilder? paginationLoadingBuilder,
  26. XScrollErrorBuilder? paginationErrorBuilder,
  27. XScrollRefreshIndicatorBuilder? refreshIndicatorBuilder,
  28. XScrollRefreshIndicatorBuilder? horizontalRefreshIndicatorBuilder,
  29. bool shrinkWrap = false,
  30. bool reverse = false,
  31. bool? primary,
  32. double? cacheExtent,
  33. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  34. String? restorationId,
  35. Clip clipBehavior = Clip.hardEdge,
})

Implementation

const XScrollView({
  required this.itemBuilder,
  super.key,
  this.onInit,
  this.onLoadMore,
  this.onItemsChanged,
  this.onItemTap,
  this.initialItems = const [],
  this.initialHasMore = true,
  this.pageSize = 20,
  this.autoLoad = true,
  this.enableRefresh = true,
  this.scrollDirection = Axis.vertical,
  this.refreshTriggerExtent = 80,
  this.paginationThreshold = 200,
  this.controller,
  this.padding,
  this.physics,
  this.gridDelegate,
  this.separatorBuilder,
  this.header,
  this.footer,
  this.loadingBuilder,
  this.emptyBuilder,
  this.errorBuilder,
  this.paginationLoadingBuilder,
  this.paginationErrorBuilder,
  this.refreshIndicatorBuilder,
  this.horizontalRefreshIndicatorBuilder,
  this.shrinkWrap = false,
  this.reverse = false,
  this.primary,
  this.cacheExtent,
  this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  this.restorationId,
  this.clipBehavior = Clip.hardEdge,
}) : assert(pageSize > 0),
     assert(refreshTriggerExtent > 0),
     assert(paginationThreshold >= 0);