Instead of passing all the options to the CarouselSlider
, now you'll need to pass these option to CarouselOptions
:
CarouselSlider(
CarouselOptions(height: 400.0),
items: [1,2,3,4,5].map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
decoration: BoxDecoration(
color: Colors.amber
),
child: Text('text $i', style: TextStyle(fontSize: 16.0),)
);
},
);
}).toList(),
)
CarouselController
Since v2.0.0
, carousel_slider
plugin provides a way to pass your own CaourselController
, and you can use CaouselController
instance to manually control the carousel's position. For a more detailed example please refer to example project.
CarouselPageChangedReason
Now you can receive a CarouselPageChangedReason
in onPageChanged
callback.
pauseAutoPlayOnTouch
pauseAutoPlayOnTouch
option is removed, because it doesn't fix the problem we have. Currently, when we enable the autoPlay
feature, we can not stop sliding when the user interact with the carousel. This is a flutter's issue.
- Fix
animateTo()/jumpTo()
with non-zero initialPage
- Add on-demand item feature
- Fix
setState() called after dispose()
bug
- Scroll physics option
- onPage indexing bug
- Remove the deprecated param:
interval
,autoPlayDuration
,distortion
,updateCallback
. Please use the new param.
- Fix
enlargeCenterPage
option is not working invertical
carousel slider.
- Vertical scroll support
- Enable/disable infinite scroll
- Added
pauseAutoPlayOnTouch
option - Add documentation
- Update doc
- Added
distortion
option
- Fix hard coded number
- Fix
initialPage
bug, fix crash when widget is disposed.
Remove useless dependencies, add changelog.
Initial version.