diff --git a/lib/carousel_slider.dart b/lib/carousel_slider.dart index e64ae29..4a8a729 100644 --- a/lib/carousel_slider.dart +++ b/lib/carousel_slider.dart @@ -208,26 +208,16 @@ class CarouselSliderState extends State ); } - return RawGestureDetector( + return Listener( behavior: HitTestBehavior.opaque, - gestures: { - _MultipleGestureRecognizer: - GestureRecognizerFactoryWithHandlers<_MultipleGestureRecognizer>( - () => _MultipleGestureRecognizer(), - (_MultipleGestureRecognizer instance) { - instance.onStart = (_) { - onStart(); - }; - instance.onDown = (_) { - onPanDown(); - }; - instance.onEnd = (_) { - onPanUp(); - }; - instance.onCancel = () { - onPanUp(); - }; - }), + onPointerDown: (_) { + onPanDown(); + }, + onPointerCancel: (_) { + onPanUp(); + }, + onPointerUp: (_) { + onPanUp(); }, child: NotificationListener( onNotification: (Notification notification) { @@ -274,10 +264,6 @@ class CarouselSliderState extends State child: Container(child: child, width: width, height: height)); } - void onStart() { - changeMode(CarouselPageChangedReason.manual); - } - void onPanDown() { if (widget.options.pauseAutoPlayOnTouch) { clearTimer(); @@ -394,5 +380,3 @@ class CarouselSliderState extends State )); } } - -class _MultipleGestureRecognizer extends PanGestureRecognizer {}