flutter_carousel_slider icon indicating copy to clipboard operation
flutter_carousel_slider copied to clipboard

handle onTap event also

Open giorgio79 opened this issue 4 years ago • 8 comments

Hello,

I noticed the carousel does not scroll when I tap on the next or previous items. It only reacts to dragging.

giorgio79 avatar Jun 12 '20 05:06 giorgio79

Sorry, can you provide more info?

serenader2014 avatar Jun 14 '20 14:06 serenader2014

I think it would be Gesture Detection. When you tap on an image there is no scroll to it at the moment. You have to hold and scroll...

giorgio79 avatar Jun 14 '20 15:06 giorgio79

Hi @giorgio79 , I think you can wrap your carousel slider children in a gesture detector, and add this functionality in the gesture detector callback.

serenader2014 avatar Jun 21 '20 15:06 serenader2014

Hello, this is a continuation of the previous request as I also need this in my application. I have put an InkWell in my carousel items, but how can I access the value of the current page within that scope? I use onPageChanged (value, reason) to update my widget state. Thanks in advance!

karthikgs-in avatar Nov 22 '20 19:11 karthikgs-in

Hello.,did you solve this? ie: if you want to see full screen one of the image of the carrousel when you tap in this? how do you manage the ontap event to open the selected(tapped) image?

alexlovar avatar Jul 15 '21 19:07 alexlovar

Yes. In your case, wrap each item in a gesture detector / inkwell, and onTap, navigate to a new screen/dialog passing the index of the current item.

karthikgs-in avatar Jul 16 '21 06:07 karthikgs-in

That is not working, when u wrap Item with GestureDetector you should tap twice for onTap functionality... First tap always used to stop the animation of Carousel.

oyakyazilim avatar Apr 28 '22 07:04 oyakyazilim

That is not working, when u wrap Item with GestureDetector you should tap twice for onTap functionality... First tap always used to stop the animation of Carousel.

I experience the same behavior, is there some way to call the onTap method inside each item when the CrouselSlider is animating during autoplay animation?

fabianotavallini avatar Nov 09 '23 16:11 fabianotavallini