VxSwiper constructor

VxSwiper({
  1. Key? key,
  2. required List<Widget> items,
  3. double? height,
  4. double aspectRatio = 16 / 9,
  5. num viewportFraction = 0.8,
  6. num initialPage = 0,
  7. int realPage = 10000,
  8. bool enableInfiniteScroll = true,
  9. bool reverse = false,
  10. bool autoPlay = false,
  11. Duration autoPlayInterval = const Duration(seconds: 5),
  12. Duration autoPlayAnimationDuration = const Duration(milliseconds: 800),
  13. Curve autoPlayCurve = Curves.fastOutSlowIn,
  14. Duration? pauseAutoPlayOnTouch,
  15. bool? enlargeCenterPage = false,
  16. dynamic onPageChanged(
    1. int index
    )?,
  17. ScrollPhysics? scrollPhysics,
  18. bool isFastScrollingEnabled = false,
  19. Axis scrollDirection = Axis.horizontal,
})

Implementation

VxSwiper(
    {super.key,
    required List<Widget> this.items,
    this.height,
    this.aspectRatio = 16 / 9,
    this.viewportFraction = 0.8,
    this.initialPage = 0,
    int realPage = 10000,
    this.enableInfiniteScroll = true,
    this.reverse = false,
    this.autoPlay = false,
    this.autoPlayInterval = const Duration(seconds: 5),
    this.autoPlayAnimationDuration = const Duration(milliseconds: 800),
    this.autoPlayCurve = Curves.fastOutSlowIn,
    this.pauseAutoPlayOnTouch,
    this.enlargeCenterPage = false,
    this.onPageChanged,
    this.scrollPhysics,
    this.isFastScrollingEnabled = false,
    this.scrollDirection = Axis.horizontal})
    : realPage = enableInfiniteScroll ? realPage + initialPage : initialPage,
      itemCount = items.length,
      itemBuilder = null,
      pageController = PageController(
        viewportFraction: viewportFraction as double,
        initialPage: enableInfiniteScroll
            ? realPage + (initialPage as int)
            : initialPage as int,
      );