Home > Back-end >  How to use Draggable and InteractiveViewer together in Flutter
How to use Draggable and InteractiveViewer together in Flutter

Time:02-18

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 -

  1. Load image
  2. Pinch-zoom out to shrink the image
  3. 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.

  • Related