universal_image_with_svg

A powerful and flexible Flutter widget that unifies how you display images from various sources: network, asset, and local file. It supports SVG and raster images and leverages extended_image and flutter_svg for advanced rendering.

Features

✅ Unified widget for displaying:

  • Network images (http/https)
  • Asset images (including SVGs)
  • Local file images

✅ Customizable placeholders and error widgets
✅ Advanced gesture support via extended_image
✅ Border, radius, shape, alignment, clipping, and other UI options
✅ Tap handling
✅ Memory caching options
✅ SVG support with theming

Getting Started

Installation

Add this to your pubspec.yaml:

dependencies:
  universal_image_with_svg: ^1.0.0

Import

import 'package:universal_image_with_svg/universal_image_with_svg.dart';

Usage

UniversalImage(
  'https://example.com/image.jpg',
  width: 100,
  height: 100,
  fit: BoxFit.cover,
  borderRadius: BorderRadius.circular(8),
  placeholder: CircularProgressIndicator(),
  errorPlaceholder: Icon(Icons.error),
  onTap: () {
    print('Image tapped!');
  },
)

License

MIT

Libraries

universal_image