Search packages, repositories and app categories

Package detailsv0.6.0

interactiveviewer_gallery

Image and video preview component that supports zoom and drag

AndroidiOSWebmacOSWindowsLinux
30-day downloads
1.3K
Likes
68
Pub points
135

Install package

flutter pub add interactiveviewer_gallery

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that provides an interactive viewer for images and videos, enabling smooth zooming and dragging gestures. Designed for previewing high-resolution media with intuitive touch controls across multiple platforms. The component supports both static images and video playback within the same interactive interface, making it ideal for galleries, product showcases, or detailed visual content exploration. Built with performance and responsiveness in mind, it integrates seamlessly into existing Flutter apps.

Use cases

  • Image zoom and pan in galleries
  • Interactive video previews
  • Product detail views
  • High-resolution image browsing
  • Digital art or document viewing

Key features

  • Zoom and drag gestures
  • Support for images and videos
  • Cross-platform compatibility
  • Smooth animation transitions
  • Built-in gesture handling

Suitable for

  • Media-rich applications
  • E-commerce product displays
  • Educational or technical documentation
  • Art and design portfolios
  • Interactive learning tools

Considerations

  • May require optimization for very large files
  • Performance depends on device capabilities
  • Limited customization of gesture behavior
  • Not intended for full-screen video playback
  • Requires proper asset loading strategies

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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

Categories

Source repository

Projects using this package

No data available yet.