GeekyAnts / infinite-carousel-flutter

Carousel in flutter. Supports features like infinite looping, friction effect, multiple scroll physics and control over item anchor and velocity.
https://pub.dev/packages/infinite_carousel
MIT License
50 stars 29 forks source link

how to use dynamic height element, bcz it uses itemExtent and its restrict for dynamic height #17

Closed rahulk3sharma closed 1 month ago

manuindersekhon commented 1 year ago

Hi @rahulk3sharma, currently the package requires itemExtent because internally it uses SliverFixedExtentList to render the items on the viewport. I used this specifically because flutter docs mention that for large or infinite lists it is more efficient if extent is known beforehand, then it does not need to perform layout on its children to obtain their dimensions.

You can modify the package to use SliverList instead of SliverFixedExtentList for dynamic extent, it does not need the parameter itemExtent as it will calculate it for every item in the list. I will try if I can include it in the package too.