UCarousel<T> constructor
const
UCarousel<T> ({
- required List<
T> items, - required Widget itemBuilder(
- BuildContext context,
- T item,
- int index
- Key? key,
- UCarouselController? controller,
- double height = 200,
- double viewportFraction = 0.9,
- int initialPage = 0,
- double itemSpacing = 0,
- bool autoPlay = false,
- Duration autoPlayInterval = const Duration(seconds: 4),
- Duration autoPlayAnimationDuration = const Duration(milliseconds: 450),
- Curve autoPlayCurve = Curves.easeInOut,
- bool pauseAutoPlayOnTouch = true,
- bool loop = false,
- bool padEnds = true,
- Axis scrollDirection = Axis.horizontal,
- ScrollPhysics? physics,
- void onPageChanged(
- T item,
- int index
- bool withIndicator = false,
- double indicatorHeight = 24,
- Color? activeIndicatorColor,
- Color? inactiveIndicatorColor,
- double indicatorActiveSize = 9,
- double indicatorInactiveSize = 7,
Implementation
const UCarousel({
required this.items,
required this.itemBuilder,
super.key,
this.controller,
this.height = 200,
this.viewportFraction = 0.9,
this.initialPage = 0,
this.itemSpacing = 0,
this.autoPlay = false,
this.autoPlayInterval = const Duration(seconds: 4),
this.autoPlayAnimationDuration = const Duration(milliseconds: 450),
this.autoPlayCurve = Curves.easeInOut,
this.pauseAutoPlayOnTouch = true,
this.loop = false,
this.padEnds = true,
this.scrollDirection = Axis.horizontal,
this.physics,
this.onPageChanged,
this.withIndicator = false,
this.indicatorHeight = 24,
this.activeIndicatorColor,
this.inactiveIndicatorColor,
this.indicatorActiveSize = 9,
this.indicatorInactiveSize = 7,
});