Swipe constructor

Swipe({
  1. required List<Widget> children,
  2. Duration? interval,
  3. bool autoPlay = false,
  4. int? initialSwipe = 0,
  5. double indicatorSize = Style.swipeIndicatorSize,
  6. Curve curve = Curves.fastOutSlowIn,
  7. Duration? duration,
  8. bool showIndicators = true,
  9. String scrollDirection = 'horizontal',
  10. double viewportFraction = 1.0,
  11. Color indicatorColor = Style.swipeIndicatorActiceBackgroundColor,
  12. dynamic onChange(
    1. int val
    )?,
  13. Widget? indicator,
})

Implementation

Swipe(
    {required this.children,
    this.interval,
    this.autoPlay: false,
    this.initialSwipe: 0,
    this.indicatorSize: Style.swipeIndicatorSize,
    this.curve: Curves.fastOutSlowIn,
    this.duration,
    this.showIndicators: true,
    this.scrollDirection: 'horizontal',
    this.viewportFraction: 1.0,
    this.indicatorColor: Style.swipeIndicatorActiceBackgroundColor,
    this.onChange,
    this.indicator})
    : _length = children.length,
      assert(children.length > 0, 'children 数量必须大于零'),
      assert(viewportFraction > 0.0);