パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.6.0

interactiveviewer_gallery

ズームおよびドラッグをサポートする画像および動画プレビュー コンポーネント

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1300
いいね数
68
Pub ポイント
135

パッケージをインストール

flutter pub add interactiveviewer_gallery

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

画像および動画のインタラクティブなビューアを提供するFlutterパッケージで、スムーズなズームとドラッグ操作を可能にします。高解像度メディアのプレビューに最適化されており、複数のプラットフォームで直感的なタッチ操作が可能です。同じインタラクティブインターフェース内で静止画像と動画再生の両方をサポートしており、ギャラリー、製品紹介、詳細なビジュアルコンテンツの探索に最適です。パフォーマンスと応答性を重視して構築されており、既存のFlutterアプリにスムーズに統合できます。

用途

  • ギャラリー内の画像のズームとパン
  • インタラクティブな動画プレビュー
  • 製品詳細ビュー
  • 高解像度画像の閲覧
  • デジタルアートまたは文書の閲覧

主な機能

  • ズームとドラッグジェスチャー
  • 画像および動画のサポート
  • クロスプラットフォーム互換性
  • スムーズなアニメーションの遷移
  • 組み込みジェスチャー処理

適している対象

  • メディア豊富なアプリケーション
  • EC商品表示
  • 教育または技術文書
  • アートとデザインのポートフォリオ
  • インタラクティブな学習ツール

注意事項

  • 非常に大きなファイルに対して最適化が必要になる可能性があります
  • パフォーマンスはデバイスの機能に依存します
  • ジェスチャー動作のカスタマイズが限定的
  • フルスクリーン動画再生には適していません
  • 適切なアセットロード戦略が必要です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

interactiveviewer_gallery

pub package

中文文档

A flutter library to show picture and video preview gallery support

  1. two-finger gesture zoom
  2. double-click to zoom
  3. switch left and right
  4. gesture back: scale, transfer, opacity of background
  5. video auto paused when miss focus

Preview

video for youtube

video for qiniu

apk download

Setup

because the library is base on InteractiveViewer so require flutter verion above or equal 1.20.0

interactiveviewer_gallery: ${last_version}

How to use

  1. Wrap Hero in your image gridview item:
Hero(
    tag: source.url,
    child: ${gridview item}
)
  1. gridview item's GestureDetector add jumping to interactiveviewer_gallery:
// DemoSourceEntity is your data model
// itemBuilder is gallery page item
void _openGallery(DemoSourceEntity source) {
  Navigator.of(context).push(
    HeroDialogRoute<void>(
      // DisplayGesture is just debug, please remove it when use
      builder: (BuildContext context) => InteractiveviewerGallery<DemoSourceEntity>(
          sources: sourceList,
          initIndex: sourceList.indexOf(source),
          itemBuilder: itemBuilder,
          onPageChanged: (int pageIndex) {
            print("nell-pageIndex:$pageIndex");
          },
      ),
    ),
  );
}
  1. edit itemBuilder: you can reference the example/lib/main.dart then customize
Widget itemBuilder(BuildContext context, int index, bool isFocus) {
  DemoSourceEntity sourceEntity = sourceList[index];
  if (sourceEntity.type == 'video') {
    return DemoVideoItem(
      sourceEntity,
      isFocus: isFocus,
    );
  } else {
    return DemoImageItem(sourceEntity);
  }
}

Other

Comments and pr are welcome

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。