UCarousel<T> constructor

const UCarousel<T>({
  1. required List<T> items,
  2. required Widget itemBuilder(
    1. BuildContext context,
    2. T item,
    3. int index
    ),
  3. Key? key,
  4. UCarouselController? controller,
  5. double height = 200,
  6. double viewportFraction = 0.9,
  7. int initialPage = 0,
  8. double itemSpacing = 0,
  9. bool autoPlay = false,
  10. Duration autoPlayInterval = const Duration(seconds: 4),
  11. Duration autoPlayAnimationDuration = const Duration(milliseconds: 450),
  12. Curve autoPlayCurve = Curves.easeInOut,
  13. bool pauseAutoPlayOnTouch = true,
  14. bool loop = false,
  15. bool padEnds = true,
  16. Axis scrollDirection = Axis.horizontal,
  17. ScrollPhysics? physics,
  18. void onPageChanged(
    1. T item,
    2. int index
    )?,
  19. bool withIndicator = false,
  20. double indicatorHeight = 24,
  21. Color? activeIndicatorColor,
  22. Color? inactiveIndicatorColor,
  23. double indicatorActiveSize = 9,
  24. 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,
});