Swiper constructor
Swiper({
- Key? key,
- Axis direction = Axis.horizontal,
- bool autoStart = true,
- SwiperController? controller,
- SwiperIndicator? indicator,
- int speed = 300,
- Duration interval = const Duration(seconds: 3),
- bool circular = false,
- bool reverse = false,
- AlignmentDirectional indicatorAlignment = AlignmentDirectional.bottomCenter,
- 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;
}