Flutter Minimizing Tips

A minimalist guide for size optimizations for Flutter

Rei
Published in
5 min readOct 14, 2021

--

In this article, I’ll talk about how to reduce apk size in Flutter

1. Use SVG for icons and vector images

2. Use WEBP instead of JPG/PNG

Short Explanation

It’s like JPG/PNG but it’s ~25% smaller in size

Long Explanation

3. Shake Your Icons

For iOS

If you’re building from Xcode, you can set the TREE_SHAKE_ICONS environment variable

For Android

It would be setting the tree-shake-icons property in the gradle.properties

Short Explanation

Flutter has the functionality to shake out unused icons from Material, Cupertino, FontAwesome, etc. fonts.

Long Explanation

4. Whatever you use, COMPRESS it!

Everybody knows they can and should JPG/PNG compress but how many people know you can also compress SVG and WEBP images?

5. Zip your animations, too!

--

--