How to Make Better Use of SVG in Flutter Applications?


Current Application

The Main Version of Flutter Does Not Support SVG

Operating Systems Have No Intention to Support SVG

Unlike SVG, Vector Fonts Are Supported

  • Mainstream operating systems provide native support for them.
  • They are basically monochrome.
  • They are independent on Extensible Markup Language (XML) files.
  • Due to monochrome output, many uncontrollable factors that have impacts on the performance, such as layer rendering and overlays, are excluded.
  • They facilitate bitmap caching management in the system. We can further explore this when building future developer tools.

Improve SVG Application by Combining with Tools and Processes

Make SVG Great Again

placeholderBuilder: (BuildContext context) => Container(
child: const CircularProgressIndicator()),
placeholderBuilder: (BuildContext context) => Container(
child: const CircularProgressIndicator()),

Use Tools to Avoid Pitfalls

How flutter_svg Works


String assetName, {
Key key,
this.matchTextDirection = false,
AssetBundle bundle,
String package,
this.height, = BoxFit.contain,
this.alignment =,
this.allowDrawingOutsideViewBox = false,
Color color,
BlendMode colorBlendMode = BlendMode.srcIn,
this.excludeFromSemantics = false,
}) : pictureProvider = ExactAssetPicture(
allowDrawingOutsideViewBox == true
? svgStringDecoderOutsideViewBox
: svgStringDecoder,
bundle: bundle,
package: package,
colorFilter: _getColorFilter(color, colorBlendMode)),
super(key: key);
void _resolveImage() {
final PictureStream newStream = widget.pictureProvider
assert(newStream ! = null);
// in PictureProvider<T>.resolve
() => load(key, onError: onError),

Obtain the Rasterization Duration

Additional Information

Android VectorDrawable

Optimization of Bitmap Caching for Individual SVG Files


Original Source:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website: