搜尋分類、套件與程式碼儲存庫

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 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。