any_image_view library

A versatile Flutter image viewer supporting multiple image formats.

This library provides AnyImageView, a single widget that can display:

  • Network images (HTTP/HTTPS URLs)
  • Network SVG images (URLs ending with .svg)
  • Local asset images (PNG, JPG, WebP, GIF, etc.)
  • SVG graphics (local assets and network), with optional svgColor / svgColorFilter
  • Lottie animations (JSON/ZIP)
  • XFile objects (from image_picker)
  • Local file paths

Features

  • Built-in shimmer loading animation
  • Automatic error handling with broken_image fallback
  • Pinch-to-zoom support
  • HTTP headers for authenticated requests
  • Customizable styling (border, shadow, shape)

Usage

import 'package:any_image_view/any_image_view.dart';

AnyImageView(
  imagePath: 'https://example.com/image.jpg',
  height: 200,
  width: 200,
  borderRadius: BorderRadius.circular(12),
)

Classes

AnyImageView
A widget that displays an image from various sources (local file, network, SVG, etc.) with customizable properties, premium skeleton loading effect, and optional zoom.
Shimmer
A widget that creates a shimmer effect, often used as a loading placeholder.

Enums

ImageType
Supported image types for AnyImageView.

Extensions

ImageTypeExtension on String
Extension to detect image type from a string path.