pinch_to_zoom_scrollable 0.1.2

SDKflutter
Platformandroidioswindowslinuxmacosweb

A widget based on fork of Interactive Viewer (pinch wins over ScrollView in GestureArena) that makes picture pinch zoom, and return to its initial size and position when released.

PinchToZoomScrollable

A widget that makes another one pinch zoom, and return to its initial size and position when released.

PinchToZoomScrollableWidget is based on a fork of InteractiveViewer because the standard widget loses to ScrollView on GestureArena.

Also, the widget can preserve its state by transitioning to the Overlay and back.

Example
Example

Usage

1. add dependencies into you project pubspec.yaml file
dependencies:
  pinch_to_zoom_scrollable: ^0.1.1

Run flutter packages get in the root directory of your app.

2. import pinch_to_zoom_scrollable lib
import 'package:pinch_to_zoom_scrollable/pinch_to_zoom_scrollable.dart';

Now you can use PinchToZoomScrollableWidget as a widget in your code.

PinchToZoomScrollableWidget Props

propstypesdescription
childWidgetChild Widget. If [zoomChild] is null, child widget is used for zooming.
zoomChildWidget?Widget for zooming.
resetDurationDurationThe duration of the reset animation. Default is Duration(milliseconds: 200).
resetCurveCurveThe curve of the reset animation. Default is Curves.ease.
clipBehaviorClipClipping behavior for InteractiveViewer. Default is Clip.none.
maxScaledoubleThe maximum allowed scale. Default to 8.
overlayColorColorOverlay background color. Default is Color(0x42000000).
saveStateboolUse [GlobalKey] for saving state of [child]. Default is False.
rootOverlayboolOverlay.of(context) will use rootOverlay. Default is False.

Feel free to fork this repository and send pull request 🏁👍