π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix: Register callback for scaleStateChangedCallback
Neeraj Guptaf66de8829b93
diff --git a/lib/ui/viewer/file/zoomable_image.dart b/lib/ui/viewer/file/zoomable_image.dartindex 51597e90e2..9ae8891b35 100644--- a/lib/ui/viewer/file/zoomable_image.dart+++ b/lib/ui/viewer/file/zoomable_image.dart@@ -54,12 +54,18 @@ class _ZoomableImageState extends State<ZoomableImage>bool _loadedFinalImage = false;PhotoViewController _photoViewController = PhotoViewController();double? _initialScale;+ bool _isZooming = false;+ ValueChanged<PhotoViewScaleState>? _scaleStateChangedCallback;@overridevoid initState() {_photo = widget.photo;_logger = Logger("ZoomableImage");_logger.info('initState for ${_photo.generatedID} with tag ${_photo.tag}');+ _scaleStateChangedCallback = (value) {+ _isZooming = value != PhotoViewScaleState.initial;+ debugPrint("isZooming = $_isZooming, currentState $value");+ };super.initState();}@@ -81,6 +87,7 @@ class _ZoomableImageState extends State<ZoomableImage>if (_imageProvider != null) {content = PhotoViewGallery.builder(gaplessPlayback: true,+ scaleStateChangedCallback: _scaleStateChangedCallback,backgroundDecoration: widget.backgroundDecoration as BoxDecoration?,builder: (context, index) {return PhotoViewGalleryPageOptions(@@ -99,24 +106,21 @@ class _ZoomableImageState extends State<ZoomableImage>} else {content = const EnteLoadingWidget();}-- dragFunction(d) => {- if (d.delta.dy > dragSensitivity)- {- {Navigator.of(context).pop()},- }- else if (d.delta.dy < (dragSensitivity * -1))- {- showDetailsSheet(context, widget.photo),- },- };-- verticalDragCallback(d) {- if (_initialScale == null ||- _photoViewController.scale! <= _initialScale!) {- dragFunction(d);- }- }+ final GestureDragUpdateCallback? verticalDragCallback = _isZooming+ ? null+ : (d) => {+ if (!_isZooming)+ {+ if (d.delta.dy > dragSensitivity)+ {+ {Navigator.of(context).pop()},+ }+ else if (d.delta.dy < (dragSensitivity * -1))+ {+ showDetailsSheet(context, widget.photo),+ },+ },+ };return GestureDetector(onVerticalDragUpdate: verticalDragCallback,