r/FlutterDev • u/adigladi • Oct 28 '26
3rd Party Service Flutter SVG baker
Has anyone else struggled with SVGs not showing shadows/blurs correctly in Flutter and had to go back and forth with a designer to explain and fix everything that will not be rendered? Well I have, and after having gotten tired of manually editing and running svgo to minify svgs I [insert Beckham be honest meme], ahem Claude, have made a tool to make this easier and quicker.
Introducing: https://adigladi.github.io/flutter-svg-baker/
Upload folders, files or paste SVGs directly to then get previews and automatic fixes for shadows that won't show in the flutter app, replacing them with baked layers in the svg. Optional svgo optimization can be toggled and then individual files can be exported or a zip with all files.
I just wanted a tool like this myself and though I would share if it would help someone else. Repo is public with MIT license, do with this info what you want. Would love to hear ideas, comments, feedback and why/if this is a terrible idea performance wise or similar.
2
u/AhmedZNOUDA Oct 28 '26
Nice approach, and solving the Gaussian falloff for the 8 layers instead of eyeballing it is a good touch.
On your performance question: I'd look at the group opacity. When the artwork has several shapes, each shadow layer gets wrapped in a <g opacity>, and in Flutter group opacity usually means a saveLayer. So one icon could cost 8 offscreen layers per shadow, which is fine for a hero illustration but might show up in a list of 50 icons on a budget Android phone. Where the shapes don't overlap, putting the opacity on each shape instead of the group would avoid that. Worth comparing with the performance overlay on a long ListView.
Also, have you tried running the baked files through vector_graphics_compiler? Precompiling would at least take the bigger path data out of parse time.
1
u/ObjectiveAddress3051 Oct 30 '26
is the baked shadow a raster image embedded in the svg or still vector paths? if it's raster the files can get big fast, and that adds up if you ship a lot of them in the app bundle. would be good to see before/after sizes in the readme
2
u/[deleted] Oct 28 '26
[removed] — view removed comment