Swiper constructor

Swiper({
  1. Key? key,
  2. Axis direction = Axis.horizontal,
  3. bool autoStart = true,
  4. SwiperController? controller,
  5. SwiperIndicator? indicator,
  6. int speed = 300,
  7. Duration interval = const Duration(seconds: 3),
  8. bool circular = false,
  9. bool reverse = false,
  10. AlignmentDirectional indicatorAlignment = AlignmentDirectional.bottomCenter,
  11. required List<Widget>? children,
})

Implementation

Swiper({
  Key? key,
  this.direction = Axis.horizontal,
  this.autoStart = true,
  this.controller,
  this.indicator,
  this.speed = 300,
  this.interval = const Duration(seconds: 3),
  this.circular = false,
  this.reverse = false,
  this.indicatorAlignment = AlignmentDirectional.bottomCenter,
  required this.children,
})  : childCount = children!.length,
      super(key: key) {
  assert(childCount > 0);
  if (circular && (children!.length) > 1) {
    List<Widget> _children = [children!.last, children!.first];
    _children.insertAll(1, children!);
    children = _children;
  }
  _itemCount = children!.length;
}