From 6eefffaee440f516627be26bdb58dc4427ad1b51 Mon Sep 17 00:00:00 2001 From: Fareez Iqmal <60868965+iqfareez@users.noreply.github.com> Date: Sun, 19 Nov 2023 06:58:59 +0800 Subject: [PATCH] :sparkles: Update zooming behavior when on web --- lib/views/image_viewer.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/views/image_viewer.dart b/lib/views/image_viewer.dart index fc60d6f..febf883 100644 --- a/lib/views/image_viewer.dart +++ b/lib/views/image_viewer.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; class ImageViewer extends StatefulWidget { @@ -53,6 +54,8 @@ class _ImageViewerState extends State } void _onInteractionEnd(ScaleEndDetails details) { + // If on web, stay the zoom position + if (kIsWeb) return; _animateResetInitialize(); } @@ -78,6 +81,7 @@ class _ImageViewerState extends State title: Text(widget.name), ), body: InteractiveViewer( + panAxis: PanAxis.aligned, transformationController: _transformationController, onInteractionStart: _onInteractionStart, onInteractionEnd: _onInteractionEnd,