Creates an ImageProvider from an SVG asset with proper scaling of the underlying vector graphics.

Features

  • Load SVG images from assets
  • Scale SVG images to fit a given container size
  • Safely finish pending SVG rasterization when listeners are removed or the image cache is cleared

Getting started

Add the package to your pubspec.yaml file:

dependencies:
  svg_image_provider: ^0.1.3

Usage

SvgImageProvider(
            'assets/images/placeholder.svg',
            scale: 1.0,
            containerSize: Size(100, 100),
)

Additional information

My name is Fredrik Borgström, and if you have any suggestions or want to report a bug, you can reach me through my web site at abcx3.com, or you can submit an issue on the GitHub repository. The package is open source and contributions are welcome.

Libraries

svg_image_provider