Swipe constructor
Swipe({
- required List<
Widget> children, - Duration? interval,
- bool autoPlay = false,
- int? initialSwipe = 0,
- double indicatorSize = Style.swipeIndicatorSize,
- Curve curve = Curves.fastOutSlowIn,
- Duration? duration,
- bool showIndicators = true,
- String scrollDirection = 'horizontal',
- double viewportFraction = 1.0,
- Color indicatorColor = Style.swipeIndicatorActiceBackgroundColor,
- dynamic onChange(
- int val
- 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);