Image Viewer 360

image_viewer_360 is a Flutter widget for presenting 360-degree product image sequences. It supports drag rotation, zoom, autoplay, frame preloading, and cache warming for network images.

Features

  • Drag horizontally to rotate through frames.
  • Play, pause, previous, and next controls.
  • Zoom and pan the current frame with InteractiveViewer.
  • Preload nearby decoded frames for smoother rotation.
  • Warm the remaining frames in the disk cache.
  • Customize loading, empty, and placeholder states.

Installation

Add the package to your app:

dependencies:
  image_viewer_360: ^0.1.1

Then import it:

import 'package:image_viewer_360/image_viewer_360.dart';

Usage

ImageViewer360(
  imageUrls: productFrameUrls,
  minBufferToPlay: 6,
  prefetchAhead: 8,
)

The imageUrls list should contain frame URLs in display order.

Custom UI

ImageViewer360(
  imageUrls: productFrameUrls,
  loadingBuilder: (context, {
    required readyFrameCount,
    required totalFrameCount,
    required progress,
  }) {
    return Center(
      child: Text('$readyFrameCount of $totalFrameCount frames ready'),
    );
  },
  placeholderBuilder: (context) {
    return const Center(child: Icon(Icons.image_not_supported_outlined));
  },
)

Libraries

image_viewer_360
A Flutter widget for rendering 360-degree product image sequences.