public SwiperPluginConfig( int activeIndex, int itemCount, PageIndicatorLayout indicatorLayout, bool outer, Axis scrollDirection, SwiperController controller, PageController pageController, SwiperLayout layout, bool loop) { D.assert(scrollDirection != null); D.assert(controller != null); this.activeIndex = activeIndex; this.itemCount = itemCount; this.indicatorLayout = indicatorLayout; this.outer = outer; this.scrollDirection = scrollDirection; this.controller = controller; this.pageController = pageController; this.layout = layout; this.loop = loop; }
public SwiperPluginConfig( int?activeIndex = null, int?itemCount = null, PageIndicatorLayout?indicatorLayout = null, bool?outer = null, Axis scrollDirection = Axis.horizontal, SwiperController controller = null, PageController pageController = null, SwiperLayout layout = SwiperLayout.normal, bool?loop = null ) { D.assert(controller != null); D.assert(itemCount != null); this.activeIndex = activeIndex; this.itemCount = itemCount.Value; this.indicatorLayout = indicatorLayout; this.outer = outer; this.scrollDirection = scrollDirection; this.controller = controller; this.pageController = pageController; this.layout = layout; this.loop = loop; }
public static Swiper Children( Key key, IndexedWidgetBuilder itemBuilder, PageTransformer transformer, int itemCount, ValueChanged <int> onIndexChanged, int index, SwiperOnTap onTap, List <SwiperPlugin> plugins, SwiperPlugin control, ScrollPhysics physics, SwiperController controller, SwiperPlugin pagination, CustomLayoutOption customLayoutOption, List <Widget> children, /// since v1.0.0 float containerHeight, float containerWidth, float itemHeight, float itemWidth, float scale, float fade, /// Curve curve, float viewportFraction = 1.0f, bool autoplay = false, bool loop = true, Axis scrollDirection = Axis.horizontal, SwiperLayout layout = SwiperLayout.DEFAULT, int autoplayDelay = kDefaultAutoplayDelayMs, bool autoplayDisableOnInteraction = true, int duration = kDefaultAutoplayTransactionDuration, bool outer = false, PageIndicatorLayout indicatorLayout = PageIndicatorLayout.NONE, bool reverse = false ) { D.assert(children != null, () => "children must not be null"); return(new Swiper( transformer: transformer, customLayoutOption: customLayoutOption, containerHeight: containerHeight, containerWidth: containerWidth, viewportFraction: viewportFraction, itemHeight: itemHeight, itemWidth: itemWidth, outer: outer, scale: scale, fade: fade, autoplay: autoplay, autoplayDelay: autoplayDelay, autoplayDisableOnInteraction: autoplayDisableOnInteraction, duration: duration, onIndexChanged: onIndexChanged, index: index, onTap: onTap, curve: curve ?? Curves.ease, scrollDirection: scrollDirection, pagination: pagination, control: control, controller: controller, loop: loop, plugins: plugins, physics: physics, key: key, itemBuilder: (BuildContext context, int ind) => { return children[ind]; }, itemCount: children.Count)); }
public Swiper( IndexedWidgetBuilder itemBuilder, int itemCount, SwiperPlugin pagination, SwiperPlugin control, /// since v1.0.0 float containerHeight, float containerWidth, float itemHeight, float itemWidth, float scale = 1, float fade = 1, CustomLayoutOption customLayoutOption = null, SwiperController controller = null, PageTransformer transformer = null, int index = 0, List <SwiperPlugin> plugins = null, ValueChanged <int> onIndexChanged = null, ScrollPhysics physics = null, /// SwiperOnTap onTap = null, Curve curve = null, Key key = null, float viewportFraction = 1.0f, bool autoplay = false, bool loop = true, Axis scrollDirection = Axis.horizontal, SwiperLayout layout = SwiperLayout.DEFAULT, int autoplayDelay = kDefaultAutoplayDelayMs, bool autoplayDisableOnInteraction = true, int duration = kDefaultAutoplayTransactionDuration, bool outer = false, PageIndicatorLayout indicatorLayout = PageIndicatorLayout.NONE ) : base(key: key) { D.assert(itemBuilder != null || transformer != null, () => { return("itemBuilder and transformItemBuilder must not be both null"); }); D.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"); this.itemBuilder = itemBuilder; this.indicatorLayout = indicatorLayout; this.transformer = transformer; this.onIndexChanged = onIndexChanged; this.itemCount = itemCount; this.index = index; this.onTap = onTap; this.plugins = plugins; this.control = control; this.physics = physics; this.controller = controller; this.pagination = pagination; this.customLayoutOption = customLayoutOption; this.containerHeight = containerHeight; this.containerWidth = containerWidth; this.viewportFraction = viewportFraction; this.itemHeight = itemHeight; this.itemWidth = itemWidth; this.scale = scale; this.fade = fade; this.curve = curve ?? Curves.ease; this.autoplay = autoplay; this.loop = loop; this.scrollDirection = scrollDirection; this.layout = layout; this.autoplayDelay = autoplayDelay; this.autoplayDisableOnInteraction = autoplayDisableOnInteraction; this.duration = duration; this.outer = outer; }