CarouselOptions constructor
CarouselOptions({
- double? height,
- double aspectRatio = 16 / 9,
- double viewportFraction = 0.8,
- int initialPage = 0,
- bool enableInfiniteScroll = true,
- bool reverse = false,
- bool autoPlay = false,
- Duration autoPlayInterval = const Duration(seconds: 4),
- Duration autoPlayAnimationDuration = const Duration(milliseconds: 800),
- Curve autoPlayCurve = Curves.fastOutSlowIn,
- bool? enlargeCenterPage = false,
- dynamic onPageChanged(
- int index,
- CarouselPageChangedReason reason
- ValueChanged<
double?> ? onScrolled, - ScrollPhysics? scrollPhysics,
- bool pageSnapping = true,
- Axis scrollDirection = Axis.horizontal,
- bool pauseAutoPlayOnTouch = true,
- bool pauseAutoPlayInFiniteScroll = false,
- PageStorageKey? pageViewKey,
- CenterPageEnlargeStrategy enlargeStrategy = CenterPageEnlargeStrategy.scale,
- bool disableCenter = false,
- bool padEnds = true,
- Clip clipBehavior = Clip.hardEdge,
Implementation
CarouselOptions({
this.height,
this.aspectRatio = 16 / 9,
this.viewportFraction = 0.8,
this.initialPage = 0,
this.enableInfiniteScroll = 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.disableCenter = false,
this.padEnds = true,
this.clipBehavior = Clip.hardEdge,
});