0

I would like to use InteractiveViewer to zoom and pan an image. On top of that image I want to position another widget which should always have a fixed size and mark a specific location on the image. Think of a pin on a map. The map can be zoomed but the pin keeps its initial size.

Something like this:

InteractiveViewer(
  child: Stack(
    children: [
      Image.network('http://placekitten.com/400/400'),
      const Positioned(
        left: 100,
        top: 100,
        child: SizedBox( //    <-- this should not change its size 
          width: 24,
          height: 24,
          child: Icon(Icons.pin_drop, color: Colors.red),
        ),
      ),
    ],
  ),
);

I can't prevent the pin from changing it's size when the image is zoomed.

2
  • 2
    stackoverflow.com/questions/75090991/… - the first case Commented Mar 14, 2023 at 14:52
  • My first thought is to put the InteractiveViewer inside the Stack. Commented Mar 14, 2023 at 15:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.