skip to Main Content

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

2

Answers


  1. 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search