SVG to Flutter path converter

Convert your SVG file directly to Flutter paths and prevent all the messing with bezier curves.
Just tap on the Convert SVG button, choose your SVG file and you can obtain the resulting Flutter code from the text field below.
If you want to see realworld example input and output, hit the respective buttons underneath. The examples are the ones from the howto.

Convert SVG
Example input
Example output
Copy code
            

Flutter code

Howto

This tutorial describes the usage including the SVG creation using an actual example.

Advantages

  • No manual dealing with code that creates bezier paths
  • The code that is being returned from the converter is designed to be rather readable (no long numbers with high precision) and can thus be edited afterwards
  • The converter supports multiple paths at once in the SVG file
  • It softens curves a little
  • The boundaries of the existing paths are detected automatically. So no values except for the SVG file need to be provided
  • Aside from path nodes in the SVG the converter also converts rect and circle nodes
  • Colors are recognized from the shapes and find their representation in the output as well

Caveats

  • For the converter to properly convert the SVG into a Path it is recommended to put everything to (0,0) of the canvas (except for the paths that are supposed to be shifted)
  • If padding is desired, a rect should be wrapped around everything with the respective padding towards every shape
  • Every group in the SVG should be dissolved before the conversion as it can lead to side-effects

Also interesting

If you like what you’ve read, feel free to support me:

🥗Buy me a salad

4 thoughts on “SVG to Flutter path converter”

    • Well I have no reason to shut it down 🙂
      Maybe I could make it open source so that people could also run it offline. Will put this on my list.

      Reply

Leave a Comment