Home > Enterprise >  How do I get panning value in interactive viewer in flutter?
How do I get panning value in interactive viewer in flutter?

Time:11-16

I am making a painter and when I am detect the point I want to draw in zooming mode in the interactive viewer it gets the wrong offset so I need the panning in the x-coordinate and the y-coordinate to have the correct offset

CodePudding user response:

Use GestureDetector onPanUpdate Method to get change of finger-swipe and current finger coordinates

onPanUpdate: (pan){
print('Change In X:${pan.delta.dx}');
print('Change In Y:${pan.delta.dy}');
print('Global X Coordinate:${pan.globalPosition.dx}');
print('Global Y Coordinate:${pan.globalPosition.dy}');
print('Local x Coordinate:${pan.localPosition.dx}');
print('Local Y Coordinate:${pan.localPosition.dy}');}
  • Related