VxSwiper constructor
VxSwiper({
- Key? key,
- required List<
Widget> items, - double? height,
- double aspectRatio = 16 / 9,
- num viewportFraction = 0.8,
- num initialPage = 0,
- int realPage = 10000,
- bool enableInfiniteScroll = true,
- bool reverse = false,
- bool autoPlay = false,
- Duration autoPlayInterval = const Duration(seconds: 5),
- Duration autoPlayAnimationDuration = const Duration(milliseconds: 800),
- Curve autoPlayCurve = Curves.fastOutSlowIn,
- Duration? pauseAutoPlayOnTouch,
- bool? enlargeCenterPage = false,
- dynamic onPageChanged(
- int index
- ScrollPhysics? scrollPhysics,
- bool isFastScrollingEnabled = false,
- 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,
);