This script is designed to refine and optimize SVG files for exporting to Flutter custom icons, ensuring no defective icons are generated.
-
Download Inkscape:
- Visit Inkscape's official website to download the application.
-
Add Inkscape to zshrc:
- Open the terminal and run:
nano ~/.zshrc
- Add the following line:
export PATH="/Applications/Inkscape.app/Contents/MacOS:$PATH"
- Save and exit by pressing
Ctrl + O
, thenEnter
, thenCtrl + X
, thenY
.
- Open the terminal and run:
-
Install SVGO using Homebrew:
- Ensure Homebrew is installed. If not, visit Homebrew's official website for installation instructions.
- Run the following command:
brew install svgo
-
Give the Script Permissions:
- Run the following command in the terminal, replacing
(put here the script path)
with the actual path to your script:chmod 777 (put here the script path)
- Run the following command in the terminal, replacing
Now, create a directory and put all of your icons in it, put the script in this directory, then open the terminal in this directory, drag the script in the terminal then press enter.
Screen.Recording.2024-03-03.at.7.25.30.AM.mov
Now, you can upload the refined icons to the FlutterIcon website and they will appear as expected.
We welcome contributions for additional platform setups like Windows ..etc. Happy refining! 🚀