serenader2014 / flutter_carousel_slider

A flutter carousel widget, support infinite scroll, and custom child widget.
https://pub.dev/packages/carousel_slider
MIT License
1.55k stars 517 forks source link

disableGesture: true, no't work #438

Open bigbingg opened 1 month ago

davidequadrelli-b commented 1 month ago

Same problem. With the latest version of the library 4.2.1, when setting the property disableGesture: true the carousel still swipes. I also noticed that instead of sending CarouselPageChangedReason.manual reason in the onPageChanged listener, it sends CarouselPageChangedReason.controller.

EDIT: I solved the problem without the disableGesture property but using the NeverScrollableScrollPhysics()

scrollPhysics: shouldScroll ? scrollPhysics : const NeverScrollableScrollPhysics()
iCodeee commented 3 weeks ago

Same problem. With the latest version of the library 4.2.1, when setting the property disableGesture: true the carousel still swipes. I also noticed that instead of sending CarouselPageChangedReason.manual reason in the onPageChanged listener, it sends CarouselPageChangedReason.controller.

EDIT: I solved the problem without the disableGesture property but using the NeverScrollableScrollPhysics()

scrollPhysics: shouldScroll ? scrollPhysics : const NeverScrollableScrollPhysics()

you can use physics: widget.options.scrollPhysics