Carousel constructor
Carousel({
- Key? key,
- required Widget itemBuilder(
- BuildContext context,
- int index
- required int itemCount,
- CarouselController? controller,
- double minScale = 0.64,
- ValueChanged<
int> ? onPageChanged, - bool isInfinite = false,
- bool parallaxEffect = false,
- Curve curve = Curves.ease,
- double viewportFraction = 1.0,
- Axis scrollDirection = Axis.horizontal,
- ScrollPhysics? physics = const BouncingScrollPhysics(),
- bool reverse = false,
- bool pageSnapping = true,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- bool allowImplicitScrolling = false,
- String? restorationId,
- Clip clipBehavior = Clip.none,
- ScrollBehavior? scrollBehavior,
- int initialPage = 0,
Implementation
Carousel({
Key? key,
required this.itemBuilder,
required this.itemCount,
CarouselController? controller,
this.minScale = 0.64,
this.onPageChanged,
this.isInfinite = false,
this.parallaxEffect = false,
this.curve = Curves.ease,
this.viewportFraction = 1.0,
this.scrollDirection = Axis.horizontal,
this.physics = const BouncingScrollPhysics(),
this.reverse = false,
this.pageSnapping = true,
this.dragStartBehavior = DragStartBehavior.start,
this.allowImplicitScrolling = false,
this.restorationId,
this.clipBehavior = Clip.none,
this.scrollBehavior,
this.initialPage = 0,
}) : controller = controller ?? CarouselController(),
super(key: key);