WidgetCarousel constructor
WidgetCarousel({
- required List<
Widget> items, - num viewportFraction = 1.0,
- num initialPage = 0,
- double aspectRatio = 16 / 9,
- double? height,
- num realPage = 10000,
- bool autoPlay = false,
- Duration interval = const Duration(seconds: 8),
- bool reverse = false,
- Curve autoPlayCurve = Curves.fastOutSlowIn,
- Duration autoPlayDuration = const Duration(milliseconds: 800),
- required Function updateCallback,
- bool distortion = true,
- IndicatorAlign align = IndicatorAlign.bottom,
- EdgeInsets padding = const EdgeInsets.only(bottom: 0.0),
- double indicatorWidth = 6,
- Color indicatorBackColor = Colors.white,
- Color indicatorColor = Colors.black,
Implementation
WidgetCarousel({
required this.items,
this.viewportFraction: 1.0,
this.initialPage: 0,
this.aspectRatio: 16 / 9,
this.height,
this.realPage: 10000,
this.autoPlay: false,
this.interval: const Duration(seconds: 8),
this.reverse: false,
this.autoPlayCurve: Curves.fastOutSlowIn,
this.autoPlayDuration: const Duration(milliseconds: 800),
required this.updateCallback,
this.distortion: true,
this.align = IndicatorAlign.bottom,
this.padding = const EdgeInsets.only(bottom: 0.0),
this.indicatorWidth = 6,
this.indicatorBackColor = Colors.white,
this.indicatorColor = Colors.black,
}) : pageController = new PageController(
viewportFraction: viewportFraction.toDouble(),
initialPage: realPage.toInt() + initialPage.toInt(),
);