SnappyListView constructor
SnappyListView({
- Key? key,
- PageController? controller,
- ListVisualisation? visualisation,
- ItemPositionsListener? itemPositionsListener,
- SnapAlignment? snapAlignment,
- SnapAlignment? snapOnItemAlignment,
- required int itemCount,
- required Widget itemBuilder(),
- ScrollBehavior? scrollBehavior,
- ScrollPhysics? physics,
- Axis scrollDirection = Axis.vertical,
- double? itemExtent,
- double? minCacheExtent,
- bool addAutomaticKeepAlives = true,
- bool addRepaintBoundaries = true,
- bool addSemanticIndexes = true,
- bool reverse = false,
- bool itemSnapping = false,
- void onPageChanged()?,
- PageOverscrollPhysics? overscrollPhysics,
- bool allowItemSizes = false,
- void onPageChange()?,
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);