flutter-studio / flutter-icons

Customizable Icons for Flutter :boom:
Apache License 2.0
332 stars 123 forks source link

[Feature Request] Split the lib into many subpackages by family. #29

Closed henry2man closed 4 years ago

henry2man commented 4 years ago

Hi folks.

First of all I want to thanks you. I'm currently using this package and it's great! :)

I was wondering if it makes sense split this package into several subpackages in order to optimize application size. In my case I'm just using MaterialCommunityIcons. AFAIK I have to import the whole package, including the other .ttfs & resources, increasing the total size.

Is this possible? Do I am wrong assuming that all resources are bundled into the release builds?

Regards.

henry2man commented 4 years ago

UPDATE: I've migrated my app to this package https://pub.dev/packages/material_design_icons_flutter (it's a little bit outdated but it contained 90% of my app icons).

Building my app with flutter_icons 1.1.0:

$> flutter flutter build apk --split-per-abi

Gave me these results:

-rw-rw-r-- 1 enrique enrique 12326K may  6 18:53 app-arm64-v8a-release.apk
-rw-rw-r-- 1 enrique enrique 12074K may  6 18:53 app-armeabi-v7a-release.apk
-rw-rw-r-- 1 enrique enrique 12470K may  6 18:53 app-x86_64-release.apk

And then, the same project with material_design_icons_flutter 4.0.5145 gave me these results:

-rw-rw-r-- 1 enrique enrique 11405K may  6 19:16 app-arm64-v8a-release.apk
-rw-rw-r-- 1 enrique enrique 11153K may  6 19:16 app-armeabi-v7a-release.apk
-rw-rw-r-- 1 enrique enrique 11595K may  6 19:16 app-x86_64-release.apk

You'll notice the ~1Mb size reduction... using the same icons.

I don't know if the latter package is optimized or not compared to flutter_icons but, in my case, the migration worths.

Thanks

2534290808 commented 4 years ago

Now you can just keep the font you used. See how to use

henry2man commented 4 years ago

Oh thanks! I didn't notice the new possibilities. My mistake!

In this case I think my issue doesn't make sense.

Thank you for your support.