CarouselOptions constructor

CarouselOptions({
  1. double? height,
  2. double aspectRatio = 16 / 9,
  3. double viewportFraction = 0.8,
  4. int initialPage = 0,
  5. bool enableInfiniteScroll = true,
  6. bool animateToClosest = true,
  7. bool reverse = false,
  8. bool autoPlay = false,
  9. Duration autoPlayInterval = const Duration(seconds: 4),
  10. Duration autoPlayAnimationDuration = const Duration(milliseconds: 800),
  11. Curve autoPlayCurve = Curves.fastOutSlowIn,
  12. bool? enlargeCenterPage = false,
  13. dynamic onPageChanged(
    1. int index,
    2. CarouselPageChangedReason reason
    )?,
  14. ValueChanged<double?>? onScrolled,
  15. ScrollPhysics? scrollPhysics,
  16. bool pageSnapping = true,
  17. Axis scrollDirection = Axis.horizontal,
  18. bool pauseAutoPlayOnTouch = true,
  19. bool pauseAutoPlayOnManualNavigate = true,
  20. bool pauseAutoPlayInFiniteScroll = false,
  21. PageStorageKey? pageViewKey,
  22. CenterPageEnlargeStrategy enlargeStrategy = CenterPageEnlargeStrategy.scale,
  23. double enlargeFactor = 0.3,
  24. bool disableCenter = false,
  25. bool padEnds = true,
  26. Clip clipBehavior = Clip.hardEdge,
})

Implementation

CarouselOptions({
  this.height,
  this.aspectRatio: 16 / 9,
  this.viewportFraction: 0.8,
  this.initialPage: 0,
  this.enableInfiniteScroll: true,
  this.animateToClosest: true,
  this.reverse: false,
  this.autoPlay: false,
  this.autoPlayInterval: const Duration(seconds: 4),
  this.autoPlayAnimationDuration = const Duration(milliseconds: 800),
  this.autoPlayCurve: Curves.fastOutSlowIn,
  this.enlargeCenterPage = false,
  this.onPageChanged,
  this.onScrolled,
  this.scrollPhysics,
  this.pageSnapping = true,
  this.scrollDirection: Axis.horizontal,
  this.pauseAutoPlayOnTouch: true,
  this.pauseAutoPlayOnManualNavigate: true,
  this.pauseAutoPlayInFiniteScroll: false,
  this.pageViewKey,
  this.enlargeStrategy: CenterPageEnlargeStrategy.scale,
  this.enlargeFactor: 0.3,
  this.disableCenter: false,
  this.padEnds = true,
  this.clipBehavior: Clip.hardEdge,
});