Fix pointer cancel event not handled in viewer

This commit is contained in:
Ming Ming 2021-12-11 13:38:51 +08:00
parent a88c776d7c
commit 2c8b6a0240

View file

@ -106,6 +106,12 @@ class _ImageViewerState extends State<ImageViewer>
} }
_prevFingerPosition = event.position; _prevFingerPosition = event.position;
}, },
onPointerCancel: (event) {
--_finger;
if (_finger < 2) {
_setIsZooming(false);
}
},
child: GestureDetector( child: GestureDetector(
onDoubleTap: () { onDoubleTap: () {
if (_isZoomed) { if (_isZoomed) {