搜索分类、插件与代码仓

zoom_pinch_overlay 封面
插件详情v1.4.3

zoom_pinch_overlay

一个可全局移动的Instagram风格捏合缩放小部件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
3890
喜欢数
229
Pub 分数
160

安装插件

flutter pub add zoom_pinch_overlay

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 小部件,可为图像启用类似 Instagram 的捏合缩放和全局拖动交互。它允许用户自由地在屏幕上缩放和移动图像,非常适合用于照片查看器或交互式图像展示。该叠加层支持多个平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,确保广泛的兼容性。采用流畅的手势处理,提供响应迅速且直观的缩放和拖动用户体验。

适合场景

  • 交互式图像查看
  • 照片画廊增强功能
  • 可缩放的产品预览
  • 基于手势的图像导航
  • 数字艺术探索

主要特点

  • 捏合缩放功能
  • 全局拖拽支持
  • 跨平台兼容性
  • 流畅的动画过渡
  • 可自定义叠加行为
  • 响应式触摸手势

适合对象

  • 图片密集型应用
  • 交互式媒体查看器
  • 电子商务产品展示
  • 教育内容工具
  • 用户界面原型设计

使用建议

  • 可能需要对大图像进行性能优化
  • 内置样式选项有限
  • 不适用于复杂的多点触控场景
  • 低端设备上可能出现延迟
  • 需要仔细处理手势冲突
  • 需要在所有目标平台上进行测试

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

zoom_pinch_overlay

     Buy Me A Coffee

An instagram style pinch and zoom widget for all platform completely written in pure dart!

All other "zoom_pinch" package didn't work for me because it doesnt appear on top of all other widgets which was an issue on one of my project. This package solves that problem by introducing a OverlayEntry so that it appears on top of all other widgets.

Credit to @billylev for the contribution this package.

Getting Started

Just wrap your widget that you want to be able to zoom in a ZoomOverlay

This is the values used in the video which can be found in the example folder.

ZoomOverlay(
    modalBarrierColor: Colors.black12, // Optional
    minScale: 0.5, // Optional
    maxScale: 3.0, // Optional
    animationCurve: Curves.fastOutSlowIn, // Defaults to fastOutSlowIn which mimics IOS instagram behavior
    animationDuration: Duration(milliseconds: 300), // Defaults to 100 Milliseconds. Recommended duration is 300 milliseconds for Curves.fastOutSlowIn
    twoTouchOnly: true, // Defaults to false
    onScaleStart: () {}, // optional VoidCallback
    onScaleStop: () {}, // optional VoidCallback
    child: CachedNetworkImage(
        imageUrl: imageUrl,
    ),
),

Documentations

parameter documentation
minScale Specifies the minimum multiplier it can scale outwards.
maxScale Specifies the maximum multiplier the user can zoom inwards.
twoTouchOnly specifies wither the zoom is enabled only with two fingers on the screen. Defaults to false.
child A widget to make zoomable.
animationDuration Specifies the duration when the zoom has ended and is animating back to it's original place. Defaults to Duration(milliseconds: 100)
animationCurve Specifies the curve when the zoom has ended and is animating back to it's original place. Defaults to Curves.fastOutSlowIn
modalBarrierColor Specifies the color of the background of the modal barrier.
onScaleStart Function that gets called when scaling of the widget starts.
onScaleStop Function that gets called when scaling of the widget stops.
buildContextOverlayState Overrides the default overlay state.

Medium blog post

Read the accompanying article here for more info about this package.

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。