CollectionView<T>.pullableSeparated constructor

const CollectionView<T>.pullableSeparated({
  1. Key? key,
  2. required CollectionItemBuilder<T> builder,
  3. required dynamic data(
    1. int iteration
    ),
  4. required IndexedWidgetBuilder? separatorBuilder,
  5. dynamic onRefresh()?,
  6. dynamic beforeRefresh()?,
  7. dynamic afterRefresh(
    1. dynamic data
    )?,
  8. String? headerStyle,
  9. Widget? footerLoadingIcon,
  10. dynamic transform(
    1. List<T> data
    )?,
  11. Widget? empty,
  12. LoadingStyle? loadingStyle,
  13. String? stateName,
  14. Axis? scrollDirection,
  15. bool? reverse,
  16. ScrollController? controller,
  17. bool? primary,
  18. ScrollPhysics? physics,
  19. bool? shrinkWrap,
  20. EdgeInsets? padding,
  21. double? itemExtent,
  22. Widget? prototypeItem,
  23. ChildIndexGetter? findChildIndexCallback,
  24. bool addAutomaticKeepAlives = true,
  25. bool addRepaintBoundaries = true,
  26. bool addSemanticIndexes = true,
  27. double? cacheExtent,
  28. int? semanticChildCount,
  29. DragStartBehavior? dragStartBehavior,
  30. ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior,
  31. String? restorationId,
  32. Clip? clipBehavior,
  33. Widget? header,
  34. dynamic sort(
    1. List<T> items
    )?,
  35. double? spacing,
})

Creates a pullable separated list view with pull-to-refresh and pagination support.

Example:

CollectionView<User>.pullableSeparated(
  data: (iteration) async => api.getUsers(page: iteration),
  builder: (context, item) => UserTile(user: item.data),
  separatorBuilder: (context, index) => Divider(),
)

Implementation

const CollectionView.pullableSeparated({
  super.key,
  required this.builder,
  required Function(int iteration) data,
  required this.separatorBuilder,
  this.onRefresh,
  this.beforeRefresh,
  this.afterRefresh,
  this.headerStyle,
  this.footerLoadingIcon,
  this.transform,
  this.empty,
  this.loadingStyle,
  this.stateName,
  this.scrollDirection,
  this.reverse,
  this.controller,
  this.primary,
  this.physics,
  this.shrinkWrap,
  this.padding,
  this.itemExtent,
  this.prototypeItem,
  this.findChildIndexCallback,
  this.addAutomaticKeepAlives = true,
  this.addRepaintBoundaries = true,
  this.addSemanticIndexes = true,
  this.cacheExtent,
  this.semanticChildCount,
  this.dragStartBehavior,
  this.keyboardDismissBehavior,
  this.restorationId,
  this.clipBehavior,
  this.header,
  this.sort,
  this.spacing,
}) : kind = CollectionViewKind.separated,
     crossAxisCount = null,
     mainAxisSpacing = null,
     crossAxisSpacing = null,
     isPullable = true,
     paginatedData = data,
     this.data = null;