SnappyListView constructor

SnappyListView({
  1. Key? key,
  2. PageController? controller,
  3. ListVisualisation? visualisation,
  4. ItemPositionsListener? itemPositionsListener,
  5. SnapAlignment? snapAlignment,
  6. SnapAlignment? snapOnItemAlignment,
  7. required int itemCount,
  8. required Widget itemBuilder(
    1. BuildContext,
    2. int
    ),
  9. ScrollBehavior? scrollBehavior,
  10. ScrollPhysics? physics,
  11. Axis scrollDirection = Axis.vertical,
  12. double? itemExtent,
  13. double? minCacheExtent,
  14. bool addAutomaticKeepAlives = true,
  15. bool addRepaintBoundaries = true,
  16. bool addSemanticIndexes = true,
  17. bool reverse = false,
  18. bool itemSnapping = false,
  19. void onPageChanged(
    1. int index,
    2. double size
    )?,
  20. PageOverscrollPhysics? overscrollPhysics,
  21. bool allowItemSizes = false,
  22. void onPageChange(
    1. double index,
    2. double size
    )?,
})

Creates PageView.builder with allowing dynamic sizes of items. This constructor is appropriate for page views with a large (or infinite) number of children with different sizes because the builder is called only for those children that are actually visible. See more PageView.builder

Implementation

SnappyListView({
  Key? key,
  PageController? controller,
  ListVisualisation? visualisation,
  ItemPositionsListener? itemPositionsListener,
  SnapAlignment? snapAlignment,
  SnapAlignment? snapOnItemAlignment,
  required this.itemCount,
  required this.itemBuilder,
  this.scrollBehavior,
  this.physics,
  this.scrollDirection = Axis.vertical,
  this.itemExtent,
  this.minCacheExtent,
  this.addAutomaticKeepAlives = true,
  this.addRepaintBoundaries = true,
  this.addSemanticIndexes = true,
  this.reverse = false,
  this.itemSnapping = false,
  this.onPageChanged,
  this.overscrollPhysics,
  this.allowItemSizes = false,
  this.onPageChange,
})  : controller = controller ?? PageController(),
      visualisation = visualisation ?? ListVisualisation.normal(),
      itemPositionsListener =
          itemPositionsListener ?? ItemPositionsListener.create(),
      snapAlignment = snapAlignment ?? SnapAlignment.static(0.5),
      snapOnItemAlignment = snapOnItemAlignment ?? SnapAlignment.static(0.5),
      super(key: key);