Liam87
Liam87

Reputation: 63

Flutter: Activate multiple gesture detectors after long press

I have an application where there is multiple cards in a grid that each have their own gesture detector. I want to be able to long press on one of the cards and then drag over the other cards and activate each cards gesture detector separately. I am not sure if this is possible.

Upvotes: 0

Views: 1158

Answers (2)

Harold Gaspard
Harold Gaspard

Reputation: 31

It might be too late, but use onLongPressMoveUpdate(updates) and check localOffsetFromOrigin.dx or localOffsetFromOrigin.dy for positive and negative values for left,right,up,down drag respectively.

Upvotes: 3

Haroun Hajem
Haroun Hajem

Reputation: 5628

GestureDetector has an event onPanStart which might be what you are looking for. Listen to this event on the other Cards after the LongPress event is activated.

onPanStart

A pointer has contacted the screen and has begun to move.

or else there is another widget to look into, the swipedetector, here

Upvotes: 0

Related Questions