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 30 forks source link

Set the maximum width of the horizontal carousel (not beyond the width of the screen). #26

Closed zakharov161 closed 5 months ago

zakharov161 commented 5 months ago

Is it possible to somehow achieve a change in the overall width of the horizontal carousel? In my case, I need to place the carousel in the center between the back/forward buttons and limit the number of displayed items to no more than 3. All my attempts to reduce the carousel result in size overflow.

zakharov161 commented 5 months ago

I figured it out. Just wrapped the buttons and the carousel in a Row. The carousel builder itself wrapped in a ConstrainedBox and specified the necessary dimensions in it. So that there are no problems and I picked up the correct itemExtent.