A Widget to let you have a pinch to zoom that returns to the old size after the pinch has ended. Is very similar to the way you can zoom pictures on instagram
Package selection guidance compiled from public package information, community data, and project usage.
A Flutter widget enabling pinch-to-zoom functionality that automatically returns to its original size after the gesture ends, mimicking Instagram's image zoom behavior. It provides a smooth, temporary zoom effect ideal for images or content that should not remain enlarged. The widget supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it versatile for cross-platform applications. It is lightweight and easy to integrate with minimal configuration.
Use cases
Image viewing with temporary zoom
Interactive UI elements with dynamic scaling
Cross-platform gesture-based content exploration
Enhancing user experience in photo galleries
Simple zoom effects without persistent scaling
Key features
Automatic return to original size after pinch
Smooth animation during zoom and unzoom
Supports all major Flutter platforms
Minimal setup required
Intuitive gesture recognition
Suitable for
Developers building image-heavy apps
Apps requiring temporary zoom interactions
Projects aiming for Instagram-like gestures
UI designers seeking intuitive touch feedback
Cross-platform applications with gesture needs
Considerations
Not suitable for persistent zoom states
Limited customization of zoom behavior
May require additional handling for complex layouts
Best used with static or non-scrolling content
Performance may vary with large or high-resolution images
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
This package helps to create an instagram like zoom picture. With pinch to zoom and release to unzoom
In this video I explained how to use pinch to zoom, in a flutter project
https://youtu.be/V2DglEpynF8
Features
Let's your app show zoomable images in an user friendly way.
It's a container of an uncliped interactive viewer that let's the user zoom the image occupying the entire screen.
Once you release the screen and stop the pinch interaction the image/widget will come back to it's original size in an smooth animation.
I made a video explaining how to solve the pinch to zoom inside a scroll:
https://youtu.be/FUuCOdQerpw
The problem with making a pinch working inside a scroll is that the drag of a screen,
as a simple gesture that can be done with just one finger,
tends to override the more complex scale gesture that needs two fingers to work well,
the best way I found to overcome that challenge is to change the physics of the scroll to NeverScrollableScrollPhysics()
when the second finger touch the screen, that way the scroll stops to override the scale gesture and it's easy to interact with the interactive viewer.
Another consideration that you will need to have is that to avoid losing frames of the reset animation,
you need to delay the setState that will bring the scroll back to the parent widget