Carousel constructor

Carousel({
  1. Key? key,
  2. required Widget itemBuilder(
    1. BuildContext context,
    2. int index
    ),
  3. required int itemCount,
  4. CarouselController? controller,
  5. double minScale = 0.64,
  6. ValueChanged<int>? onPageChanged,
  7. bool isInfinite = false,
  8. bool parallaxEffect = false,
  9. Curve curve = Curves.ease,
  10. double viewportFraction = 1.0,
  11. Axis scrollDirection = Axis.horizontal,
  12. ScrollPhysics? physics = const BouncingScrollPhysics(),
  13. bool reverse = false,
  14. bool pageSnapping = true,
  15. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  16. bool allowImplicitScrolling = false,
  17. String? restorationId,
  18. Clip clipBehavior = Clip.none,
  19. ScrollBehavior? scrollBehavior,
  20. 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);