I'm trying to create a map in flutter and I have this rectangle which I can Scale using a GestureDetector and the onScaleStart, onScaleUpdate and onScaleEnd events like showed in this answer: How do I pan and zoom an image? and I tried adding onHorizontalDrag and onVerticalDrag but when I do so I get an error stating that I can't have them three at the same time or they'll interfere. So how can I do if I want to have the functionality of a basic map display like (Drag in both directions and scale)? Is there a faster and cleaner way of doing it than using a GestureDetector?
Asked
Active
Viewed 946 times
0
fabriziog
- 399
- 6
- 16
-
see https://stackoverflow.com/a/55324411/2252830 – pskink May 27 '19 at 05:08
1 Answers
1
I think you just need to use the Scale gesture. It's a superset of Pan. which is a single point gesture for both vertical and horizontal movements.
Adrian Murray
- 2,170
- 1
- 13
- 15