Did you know?
With the Vector Graphics Compiler, you can precompile SVGs at build time for better rendering performance.
To do this, install the vector_graphics_compiler
package and use it as a transformer for your SVG assets (both individual files and folders are supported).
Then, simply use a VectorGraphic
widget with an AssetBytesLoader
when you want to render your assets.
VectorGraphic
acts as a replacement for the old SvgPicture
, so you can pass the same arguments, too. 👍
For a demo of the new Vector Graphics Compiler, check out this free UI challenge on Code With Andrea Pro:
Flutter 3.22 can do more than just precompiling SVGs:
- apply filters
- optimize PNGs
You can even create your own transformer packages.
For all the details, read the official docs:
Previous | Next |
---|---|
JsonCodable (Dart Macros experiment) | Flutter Web App Initialization Logic with CSS Loader |