smooth_image_viewer 0.1.0
smooth_image_viewer: ^0.1.0 copied to clipboard
A lightweight Flutter image viewer with gesture dismissal, paging, zoom, and Hero transitions.
smooth_image_viewer #
A lightweight Flutter image viewer with paging, zoom, gesture dismissal, Hero return transitions, and optional thumbnail-first rendering.
Features #
- Single-image and multi-image viewing from
ImageProviders. - Page swiping, double-tap zoom, and pinch zoom.
- Pull down to dismiss with scale and background fade.
- Optional Hero return animation for the current image.
- Double-tap zoom between 1x and 2x, centered on the tap position.
- Circle, uniform rounded-corner, and per-corner Hero shapes.
- Optional low-resolution
previewProvidersfor a fast first frame. - No networking, caching, state-management, or UI dependencies.
Usage #
ImageViewerHero(
tag: 'avatar-1',
shape: const ImageViewerShape.circle(),
child: Image(image: avatarProvider, fit: BoxFit.cover),
)
For independent corner radii, use ImageViewerShape.roundedCorners(...).
ImageViewerRoute.open(
context,
images: <ImageProvider<Object>>[avatarProvider],
initialIndex: 0,
heroTags: const <Object?>['avatar-1'],
previewProviders: <ImageProvider<Object>?>[avatarThumbnailProvider],
);
The package accepts ImageProviders so applications can choose their own
network and disk-cache implementation.
Example #
Run the interactive gallery from the package root:
cd example
flutter run