CarouselOptions constructor
CarouselOptions({
- double? height,
- double? aspectRatio,
- double viewportFraction = 0.9,
- int initialPage = 0,
- bool enableInfiniteScroll = true,
- bool reverse = false,
- bool autoPlay = false,
- Duration autoPlayInterval = const Duration(seconds: 5),
- Duration autoPlayAnimationDuration = const Duration(milliseconds: 500),
- Curve autoPlayCurve = Curves.easeInOut,
- 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 showIndicator = true,
- SlideIndicator? slideIndicator = const CircularSlideIndicator(),
Implementation
CarouselOptions({
this.height,
this.aspectRatio,
this.viewportFraction = 0.9,
this.initialPage = 0,
this.enableInfiniteScroll = true,
this.reverse = false,
this.autoPlay = false,
this.autoPlayInterval = const Duration(seconds: 5),
this.autoPlayAnimationDuration = const Duration(milliseconds: 500),
this.autoPlayCurve = Curves.easeInOut,
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.showIndicator = true,
this.slideIndicator = const CircularSlideIndicator(),
});