pro_svg_image 0.0.1 copy "pro_svg_image: ^0.0.1" to clipboard
pro_svg_image: ^0.0.1 copied to clipboard

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.

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 #

1
likes
140
points
35
downloads

Publisher

verified publishershajedul.com

Weekly Downloads

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.

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_cache_manager, flutter_image_compress, flutter_inappwebview, jovial_svg

More

Packages that depend on pro_svg_image