My question essentially duplicates the previously asked question: Flutter: How to set a max/min scale using matrix_gesture_detector
I have a MatrixGestureDetector:
MatrixGestureDetector(
onMatrixUpdate: (m, tm, sm, rm) {
setState(() {
transform = m;
});
},
child: Transform(
transform: transform,
child: Image.asset("assets/maps/map.gif"),
),
),
The picture can be zoomed in and out indefinitely, but I want to limit the minimum and maximum scale.
The solution suggested in the link above is not correct for me. The scale is really limited, but when it reaches its limits, gestures start to be handled incorrectly. The picture starts moving very quickly when you try to zoom in or out when the limits are reached.
Is there any solution to this problem? Maybe there are other packages to solve my problem? PhotoViev did not satisfy me for the reason described here: Flutter PhotoView - Rotation about the point between the fingers