flutter_widget_carousel 0.0.2

SDKflutter
Platformandroidioswindowslinuxmacosweb

Widget carousel feature, implemented purely in Flutter code.

This plugin provides a widget carousel feature, supporting horizontal or vertical scrolling, automatic or manual cycling, and infinite looping.

Features

  • Any widget.
  • Infinite looping.
  • Auto carousel.

Usage

Use
    CarouselWidget(
          count: 5,
          itemBuilder: (context, index) {
            return Container(
              width: double.infinity,
              height: double.infinity,
              color: Colors.primaries[2 * index],
              child: Center(child: Text('Item $index', style: TextStyle(fontSize: 30, color: Colors.white))),
            );
          },
        )
2、Parameter description
parametertypeexplanation
countintCount of carousel items. required parameter
itemBuilderIndexedWidgetBuilderUsed to build child widgets. required parameter
scrollDirectionAxisScroll direction, default is Axis.horizontal
canManualSwitchboolWhether manual scrolling is allowed. default is true
autoCarouselboolAuto carousel is allowed, default is true
interruptCarouselboolWhether to interrupt the auto carousel after manual scrolling. default is false
loopboolWhether to enable infinite scrolling. default is true
carouselIntervalMsintAuto carousel interval, in milliseconds, default is 5000
animationDurationMsintScroll duration, in milliseconds, default is 300
animationCurveCurveAnimation curve, default is Curves.linear
changedCallbackValueChangedCarousel item changed callback, default is null
controllerPageControllerFor the PageView's controller: if not provided externally, the system will create one internally