Ejemplo n.º 1
0
 public _CustomLayoutSwiper(
     CustomLayoutOption option,
     float?itemWidth  = null,
     bool?loop        = null,
     float?itemHeight = null,
     ValueChanged <int> onIndexChanged = null,
     Key key = null,
     IndexedWidgetBuilder itemBuilder = null,
     Curve curve                 = null,
     int?duration                = null,
     int?index                   = null,
     int?itemCount               = null,
     Axis scrollDirection        = Axis.horizontal,
     SwiperController controller = null
     ) : base(
         loop: loop,
         onIndexChanged: onIndexChanged,
         itemWidth: itemWidth,
         itemHeight: itemHeight,
         key: key,
         itemBuilder: itemBuilder,
         curve: curve,
         duration: duration,
         index: index,
         itemCount: itemCount,
         controller: controller,
         scrollDirection: scrollDirection)
 {
     D.assert(option != null);
     this.option = option;
 }
Ejemplo n.º 2
0
 public Swiper(
     IndexedWidgetBuilder itemBuilder    = null,
     PageIndicatorLayout indicatorLayout = PageIndicatorLayout.none,
     PageTransformer transformer         = null,
     int?itemCount       = null,
     bool autoplay       = false,
     SwiperLayout layout = SwiperLayout.normal,
     int autoplayDelay   = SwiperUtils.kDefaultAutoplayDelayMs,
     bool autoplayDisableOnInteraction = true,
     int duration = SwiperUtils.kDefaultAutoplayTransactionDuration,
     ValueChanged <int> onIndexChanged = null,
     int?index                   = null,
     SwiperOnTap onTap           = null,
     SwiperPlugin control        = null,
     bool loop                   = true,
     Curve curve                 = null,
     Axis scrollDirection        = Axis.horizontal,
     SwiperPlugin pagination     = null,
     List <SwiperPlugin> plugins = null,
     ScrollPhysics physics       = null,
     Key key = null,
     SwiperController controller           = null,
     CustomLayoutOption customLayoutOption = null,
     float?containerHeight  = null,
     float?containerWidth   = null,
     float viewportFraction = 1.0f,
     float?itemHeight       = null,
     float?itemWidth        = null,
     bool?outer             = false,
     float?scale            = null,
     float?fade             = null
     ) : base(key: key)
 {
     D.assert(itemBuilder != null || transformer != null,
              () => "itemBuilder and transformItemBuilder must not be both null");
     D.assert(!loop || ((loop && layout == SwiperLayout.normal &&
                         (indicatorLayout == PageIndicatorLayout.scale ||
                          indicatorLayout == PageIndicatorLayout.color ||
                          indicatorLayout == PageIndicatorLayout.none)) ||
                        (loop && layout != SwiperLayout.normal)),
              () => "Only support `PageIndicatorLayout.SCALE` and `PageIndicatorLayout.COLOR`when layout==SwiperLayout.DEFAULT in loop mode"
              );
     this.itemBuilder     = itemBuilder;
     this.indicatorLayout = indicatorLayout;
     this.transformer     = transformer;
     this.itemCount       = itemCount;
     this.autoplay        = autoplay;
     this.layout          = layout;
     this.autoplayDelay   = autoplayDelay;
     this.autoplayDisableOnInteraction = autoplayDisableOnInteraction;
     this.duration           = duration;
     this.onIndexChanged     = onIndexChanged;
     this.index              = index;
     this.onTap              = onTap;
     this.control            = control;
     this.loop               = loop;
     this.curve              = curve ?? Curves.ease;
     this.scrollDirection    = scrollDirection;
     this.pagination         = pagination;
     this.plugins            = plugins;
     this.physics            = physics;
     this.controller         = controller;
     this.customLayoutOption = customLayoutOption;
     this.containerHeight    = containerHeight;
     this.containerWidth     = containerWidth;
     this.viewportFraction   = viewportFraction;
     this.itemHeight         = itemHeight;
     this.itemWidth          = itemWidth;
     this.outer              = outer;
     this.scale              = scale;
     this.fade               = fade;
 }