talira

vector_graphics

Render precompiled vector graphics in Flutter from a compact binary format

open sourceBSD-3-Clausefree

vector_graphics is a vector graphics rendering runtime for Flutter, maintained by the Flutter team in the flutter/packages repository. It draws pictures that vector_graphics_compiler has compiled ahead of time from SVG files into a binary encoding (read through vector_graphics_codec), so the app skips parsing SVG at runtime. The compiler handles groups, paths, shapes, gradients, text, symbols, images and patterns, and optimises the output by inlining transforms, collapsing groups and removing masks and clips where it can. It was first written by Dan Field and forked into flutter/packages from dnfield/vector_graphics.

Problems it solves

  • show SVG icons and illustrations in my Flutter app without parsing SVG at runtime
  • speed up vector images that render slowly in Flutter
  • ship vector artwork in a Flutter app that draws quickly on every platform

Features

  • Renders vector graphics in Flutter from a precompiled binary encoding
  • Paired with vector_graphics_compiler, which compiles SVG files ahead of time
  • Supports paths, shapes, linear and radial gradients, text, symbols, images and patterns
  • Compiler optimisations: transform inlining, group collapsing, mask and clip elimination
  • Runs on Android, iOS, Linux, macOS, web and Windows

Limitations

  • SVG filters and some text processing attributes aren't supported by the compiler1