-1

When i am exporting svg images from figma, these images in flutter are not rendering and throwing error ? Even using flutter_svg package.

enter image description here

Phanindra
  • 1,110
  • 2
  • 11
  • 24
  • 1
    is this answer of your question?https://stackoverflow.com/questions/61202925/svgpicture-image-rendering-error-in-flutter#answer-62773031 – Robin Hood Dec 13 '22 at 13:18

2 Answers2

1

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.

dinjooh
  • 66
  • 2
0

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.

Abigotado
  • 75
  • 6