Is there any performance gain with FlutterIcons instead of using the SVG directly?

Viewed 221

Is there any performance gain or any other advantage to use fluttericon or fluttericon instead of just using each icon svg directly with flutter_svg for example?

1 Answers

This question is a bit old so you might have already found the answer but here's my take on the subject:

Performances

Performance-wise, while the package flutter_svg has improved a lot over time, it is still a complex widget which will parse an SVG file and try to render it with its properties. There is still a few issues that are related to performances whenever you try to display a high number of svg widget:

Solution such as fluttericon or any other package to provide more icons through fonts will always provide better rendering performances as it is as simple as rendering a text.

Now which one to choose between fluttericon and a font file generated by the website fluttericon.com ?

Fluttericon (package) vs. FlutterIcon (web)

Well as said by Ravindra and ilikerobots importing directly the package fluttericon would increase the size of your application because it would contains all the font packs. It is also mentioned in the package's README file:

Please note this package is not intended for production use, due to the large size. Instead, it can be used as a development aid to help identify/test icons.

For production use, it is highly recommended to use FlutterIcon to customize your icon pack, limiting your icon font to needed icons and building your own from custom SVG.

Conclusion

So the best choice in terms of performance and app size would be to use FlutterIcon and only select the icons you want to include in your application. The package should only be used to try out which icon would fit your needs while developing.

Finally, the package flutter_svg should be mostly used if you need to display some complex SVG that cannot be imported accurately with FlutterIcon.

Related