Try this package: jovial_svg. If it doesn’t help, you will need to edit your svg (just deleting defs not always helps). Or to write your own render for it.
You will need to move your <defs> statements to the beginning of the file instead. Save your svg’s as normally through Figma and open it with your text editor of choice. Find the <defs></defs> statements and move them up as the first children of the <svg> element.
It is described in further detail here by the author of the flutter_svg package.
If everything else fails and you have a particular annoying svg, I’ve had success with using various svg optimizer tools found online.
2
Answers
Try this package: jovial_svg. If it doesn’t help, you will need to edit your svg (just deleting
def
s not always helps). Or to write your own render for it.You will need to move your
<defs>
statements to the beginning of the file instead. Save your svg’s as normally through Figma and open it with your text editor of choice. Find the<defs>
</defs>
statements and move them up as the first children of the<svg>
element.It is described in further detail here by the author of the flutter_svg package.
If everything else fails and you have a particular annoying svg, I’ve had success with using various svg optimizer tools found online.