Swiper constructor

Swiper({
  1. required IndexedWidgetBuilder itemBuilder,
  2. PageIndicatorLayout indicatorLayout = PageIndicatorLayout.NONE,
  3. PageTransformer? transformer,
  4. required int itemCount,
  5. bool autoplay = false,
  6. SwiperLayout? layout = SwiperLayout.DEFAULT,
  7. int autoplayDelay = kDefaultAutoplayDelayMs,
  8. bool autoplayDisableOnInteraction = true,
  9. int duration = kDefaultAutoplayTransactionDuration,
  10. ValueChanged<int>? onIndexChanged,
  11. int? index,
  12. SwiperOnTap? onTap,
  13. SwiperPlugin? control,
  14. bool loop = true,
  15. Curve curve = Curves.ease,
  16. Axis scrollDirection = Axis.horizontal,
  17. SwiperPlugin? pagination,
  18. List<SwiperPlugin>? plugins,
  19. ScrollPhysics? physics,
  20. Key? key,
  21. SwiperController? controller,
  22. CustomLayoutOption? customLayoutOption,
  23. double? containerHeight,
  24. double? containerWidth,
  25. double viewportFraction = 1.0,
  26. double itemHeight = double.infinity,
  27. double itemWidth = double.infinity,
  28. bool outer = false,
  29. double? scale,
  30. double? fade,
})

Implementation

Swiper({
  required this.itemBuilder,
  this.indicatorLayout: PageIndicatorLayout.NONE,

  ///
  this.transformer,
  required this.itemCount,
  this.autoplay: false,
  this.layout: SwiperLayout.DEFAULT,
  this.autoplayDelay: kDefaultAutoplayDelayMs,
  this.autoplayDisableOnInteraction: true,
  this.duration: kDefaultAutoplayTransactionDuration,
  this.onIndexChanged,
  this.index,
  this.onTap,
  this.control,
  this.loop: true,
  this.curve: Curves.ease,
  this.scrollDirection: Axis.horizontal,
  this.pagination,
  this.plugins,
  this.physics,
  Key? key,
  this.controller,
  this.customLayoutOption,

  /// since v1.0.0
  this.containerHeight,
  this.containerWidth,
  this.viewportFraction: 1.0,
  this.itemHeight = double.infinity,
  this.itemWidth = double.infinity,
  this.outer: false,
  this.scale,
  this.fade,
})  : assert(
          !loop ||
              ((loop &&
                      layout == SwiperLayout.DEFAULT &&
                      (indicatorLayout == PageIndicatorLayout.SCALE ||
                          indicatorLayout == PageIndicatorLayout.COLOR ||
                          indicatorLayout == PageIndicatorLayout.NONE)) ||
                  (loop && layout != SwiperLayout.DEFAULT)),
          "Only support `PageIndicatorLayout.SCALE` and `PageIndicatorLayout.COLOR`when layout==SwiperLayout.DEFAULT in loop mode"),
      super(key: key);