Skip to content

Commit

Permalink
✨ Update zooming behavior when on web
Browse files Browse the repository at this point in the history
  • Loading branch information
iqfareez committed Nov 18, 2023
1 parent 07152af commit 6eefffa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/views/image_viewer.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

class ImageViewer extends StatefulWidget {
Expand Down Expand Up @@ -53,6 +54,8 @@ class _ImageViewerState extends State<ImageViewer>
}

void _onInteractionEnd(ScaleEndDetails details) {
// If on web, stay the zoom position
if (kIsWeb) return;
_animateResetInitialize();
}

Expand All @@ -78,6 +81,7 @@ class _ImageViewerState extends State<ImageViewer>
title: Text(widget.name),
),
body: InteractiveViewer(
panAxis: PanAxis.aligned,
transformationController: _transformationController,
onInteractionStart: _onInteractionStart,
onInteractionEnd: _onInteractionEnd,
Expand Down

0 comments on commit 6eefffa

Please sign in to comment.