@@ -20,6 +20,8 @@ class CarouselSlider extends StatefulWidget {
2020 /// [CarouselOptions] to create a [CarouselState] with
2121 final CarouselOptions options;
2222
23+ final bool ? disableGesture;
24+
2325 /// The widgets to be shown in the carousel of default constructor
2426 final List <Widget >? items;
2527
@@ -36,6 +38,7 @@ class CarouselSlider extends StatefulWidget {
3638 CarouselSlider (
3739 {required this .items,
3840 required this .options,
41+ this .disableGesture,
3942 CarouselController ? carouselController,
4043 Key ? key})
4144 : itemBuilder = null ,
@@ -50,6 +53,7 @@ class CarouselSlider extends StatefulWidget {
5053 {required this .itemCount,
5154 required this .itemBuilder,
5255 required this .options,
56+ this .disableGesture,
5357 CarouselController ? carouselController,
5458 Key ? key})
5559 : items = null ,
@@ -186,6 +190,10 @@ class CarouselSliderState extends State<CarouselSlider>
186190 AspectRatio (aspectRatio: widget.options.aspectRatio, child: child);
187191 }
188192
193+ if (true == widget.disableGesture){
194+ return wrapper;
195+ }
196+
189197 return RawGestureDetector (
190198 gestures: {
191199 _MultipleGestureRecognizer :
@@ -264,6 +272,8 @@ class CarouselSliderState extends State<CarouselSlider>
264272
265273 @override
266274 Widget build (BuildContext context) {
275+
276+
267277 return getGestureWrapper (PageView .builder (
268278 padEnds: widget.options.padEnds,
269279 scrollBehavior: ScrollConfiguration .of (context).copyWith (
0 commit comments