Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement VerticalMultiDragGestureRecognizer bottom to up gesture in flutter?

I'm trying to implement a simple two fingers swipe (bottom to up and up to bottom) in flutter, with VerticalMultiDragGestureRecognizer, but couldn't find an fully example how to work with theses recognizer, tried with Listener widget and RawGestureDetector with GestureRecognizerFactoryWithHandlers, but didn't understand how should work with custom recognizers.

What I pretend:

Two fingers bottom to up triggers an event to show page A

Two fingers up to bottom triggers an event to show page B

Extra:

Just detect two fingers event is enought for me, but if is possible, can be controll the animation of page A or B transition? Like an "Slider"? (poping the new page as the hand's moviment of user progress)

Could any one help-me with this question?

like image 617
Renê Guilherme Nucci Avatar asked Nov 07 '22 09:11

Renê Guilherme Nucci


1 Answers

I have created a sample gist on GitHub here that should guide you about how to detect two finger swipe.

Two finger swipe detection demo

like image 75
Hitesh Gupta Avatar answered Nov 15 '22 07:11

Hitesh Gupta