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

pinch_zoom 封面
套件詳情v2.0.1

pinch_zoom

一個基於 Flutter 新版 Interactive Viewer 的小部件,可實現圖片的捏合縮放,並在釋放時返回初始大小和位置。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1.2萬
喜歡數
221
Pub 分數
150

安裝套件

flutter pub add pinch_zoom

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

PinchZoom 是一個 Flutter 套件,透過 Flutter 的 InteractiveViewer 實現直觀的捏合縮放功能。它允許使用者使用觸控手勢縮放和拖曳影像,並在手勢結束時自動將影像恢復至原始大小與位置。此套件設計簡潔,跨平台表現流暢,可無縫整合至影像檢視介面。它支援所有主要平台,包含 Android、iOS、Web、macOS、Windows 與 Linux,非常適合需要互動式影像探索的跨平台應用。

適用情境

  • 互動式圖像查看器
  • 照片畫廊
  • 文件縮放
  • 帶有圖表的教育類應用程式
  • 電子商務產品圖片

主要特色

  • 基於手勢的捏合縮放
  • 自動重置為初始狀態
  • 跨平台相容性
  • 流暢的動畫過渡
  • 基於 Flutter 的 InteractiveViewer

適合對象

  • 開發圖像密集型應用的開發者
  • 需要直覺圖像導航的應用程式
  • 跨平台圖像互動功能
  • 教育或展示工具
  • 以行動裝置為首的設計,支援觸控操作

使用建議

  • 可能需要對大圖像進行優化
  • 性能取決於設備功能
  • 超出基本縮放行為之外的自訂功能有限
  • 不適用於非圖像內容
  • 需要正確處理圖像加載狀態

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

pinch_zoom

A widget based on Flutter's Interactive Viewer that makes picture pinch zoom, and return to its initial size and position when released.

This package offers Instagram based pinch zooming that feels more responsive than other similar packages.

The package is designed for zooming in on images; however, it can also be used to zoom in on a video.

Example one Example two

Installation

Add this to your pubspec.yaml dependencies:

pinch_zoom: ^2.0.1

How to use

Add the widget to your app like this (It automatically takes the size of the image you pass to it):

PinchZoom(
    child: Image.network('https://placecats.com/640/360'),
    maxScale: 2.5,
    onZoomStart: (){print('Start zooming');},
    onZoomEnd: (){print('Stop zooming');},
),

所屬分類

原始碼儲存庫

使用此套件的專案