Skip to content
pubscout

flutter_svg

2.5.0, released today by flutter.dev

Renders Scalable Vector Graphics (SVG 1.1) and precompiled vector graphics in Flutter.

Flutter FavoriteWASM-readyRock solid
$ flutter pub add flutter_svg
Source repository

What it does

flutter_svg parses and displays SVG 1.1 vector graphics directly inside Flutter widget trees from assets, network URLs, strings, or files. It allows tinting, custom color mapping, and manual rendering to a Canvas or ui.Image. It also supports loading precompiled binary vector graphics (.vec) generated by the vector_graphics_compiler for improved runtime performance.

AI-written summary of version 2.3.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Rendering SVG files from local assets, memory strings, or network endpoints.
  • Displaying resolution-independent vector icons and illustrations without raster scaling artifacts.
  • Manipulating SVG colors programmatically via color filters or ColorMapper rules.

Skip it when

  • Handling raster image formats like PNG, JPEG, or WebP without any SVG requirements.
  • Working with complex SVGs requiring full CSS styling or unsupported advanced SVG features.

Strengths

  • Supports multiple input sources including asset, network, string, and raw byte loaders.
  • Integrates with vector_graphics for ahead-of-time precompilation and faster parsing.
  • Provides granular color remapping via the ColorMapper interface and colorFilter properties.

Weaknesses

  • CSS support is limited, requiring presentation attributes instead of inline CSS for best compatibility.
  • Complex SVG features or improper configurations may fail to render as expected compared to standard web browsers.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
4
const assetName = 'assets/dart.svg';
final Widget svg = SvgPicture.asset(
  assetName,
  semanticsLabel: 'Dart Logo',
);

Alternatives

Packages that do the same job and could replace flutter_svg.

  • extended_image

    Pick extended_image when handling raster images requiring zooming, caching, panning, and crop tools rather than vector SVG rendering.

  • octo_image

    Pick octo_image when you need advanced placeholder, error, and progress indicator mechanics for raster images.

Works with

Packages commonly used together with flutter_svg: ones it builds on, ones built on it, and its own family.