pro_svg_image

A powerful and flexible **SVG Image Provider** for Flutter. Supports both high-performance rendering via jovial_svg and a **WebView fallback** for full SVG compatibility. Includes caching with flutter_cache_manager.

βœ… Compatible with latest Flutter (>=3.7)

βœ… Color-safe and scalable SVG support

βœ… WebView fallback for complex SVGs

βœ… Disk and memory caching out of the box

πŸ“¦ Installation

Add to your pubspec.yaml:

dependencies:
pro_svg_image: ^0.0.1

πŸ”§ Usage

import 'package:pro_svg_image/pro_svg_image.dart';

1. Load SVG as ImageProvider (with caching)

Image(
  image: SvgImage.cachedNetwork('https://example.com/logo.svg'),
  fit: BoxFit.contain,
);

2. Use as a Widget via ScalableImageWidget


ScalableImageWidget.fromSISource(
  si: CachedNetworkSvgSource('https://example.com/logo.svg'),
  fit: BoxFit.contain,
);

3. Fallback with WebView Rendering

Useful for complex or unsupported SVG files (e.g. filters, animations, gradients)


SvgWebImage.initWebView(); // Call once (e.g. in main())


Image(
  image: SvgWebImage.cachedNetwork(
    'https://example.com/logo.svg',
    cacheSvg: true,
  ),
  fit: BoxFit.contain,
);

πŸ› οΈ Advanced

Clear the cache manually if needed:


await SvgImage.clearCache(); // Clear all jovial_svg cache

await SvgWebImage.clearWebViewCache(); // Clear WebView cache

You can also pass your own BaseCacheManager instance for custom cache behavior.

πŸ“Œ Platform Support

| Platform | Supported | Notes |

|----------|-----------|-----------------------------|

| Android | βœ… | Fully tested |

| iOS | βœ… | Fully tested |

| Web | ❌ | Not supported |

| Desktop | 🚧 | Partial WebView support |

🧱 Dependencies

πŸ‘¨β€πŸ’» Maintainer

Maintained by Shajedul Islam

pro_svg_image

pro_svg_image

Libraries

pro_svg_image