In Flutter, I can use Draggable to drag an object, say an image. Also, using InteractiveViewer, I can pinch-zoom the same image. Am able to do these actions separately with the individual widgets, but not able to figure out how to do both together -
- Load image
- Pinch-zoom out to shrink the image
- Drag the above image to another location in the screen
How can I achieve this in Flutter?
CodePudding user response:
If you just want to scale an image (zoom in/out), you don't have to use InteractiveViewer
. You can use GestureDetector
to do scaling, rotating, and moving, all at once.
You can check out my answer to a similar question here.