Ahmadre / FlutterIconPicker

An adaptive comprehensive IconPicker for Flutter
MIT License
112 stars 76 forks source link

This application cannot tree shake icons fonts. #52

Closed nagringapp closed 1 year ago

nagringapp commented 1 year ago

I'm tyring to build to production and am getting the following error:

This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:

FAILURE: Build failed with an exception.

nagringapp commented 1 year ago

Any update on this one?

flutterWithChris commented 1 year ago

This is referenced in the documentation. Add the build argument --no-tree-shake-icons & you should be good!

nagringapp commented 1 year ago

I have added it, however, it doesn't sound like the right way to do it - it seems a workaround rather than the right approach. (I didn't need to add this argument before using this package)

On Fri, 27 Jan 2023 at 02:08, Christian Vergara @.***> wrote:

This is referenced in the documentation. Add the build argument --no-tree-shake-icons & you should be good!

— Reply to this email directly, view it on GitHub https://github.com/Ahmadre/FlutterIconPicker/issues/52#issuecomment-1405240555, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6ICBHSKPLB2PIDZ2FTLBTWUKOPXANCNFSM6AAAAAATLHSYLA . You are receiving this because you authored the thread.Message ID: @.***>

-- Kind Regards,

Thiago Bernardes Founder 0448 087 563 www.nagringa.app https://www.hungy.app/?utm_source=signature&utm_medium=email&utm_campaign=contact-tb

Ahmadre commented 1 year ago

I have added it, however, it doesn't sound like the right way to do it - it seems a workaround rather than the right approach. (I didn't need to add this argument before using this package) On Fri, 27 Jan 2023 at 02:08, Christian Vergara @.> wrote: This is referenced in the documentation. Add the build argument --no-tree-shake-icons & you should be good! — Reply to this email directly, view it on GitHub <#52 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6ICBHSKPLB2PIDZ2FTLBTWUKOPXANCNFSM6AAAAAATLHSYLA . You are receiving this because you authored the thread.Message ID: @.> -- Kind Regards, Thiago Bernardes Founder 0448 087 563 www.nagringa.app https://www.hungy.app/?utm_source=signature&utm_medium=email&utm_campaign=contact-tb

What you could try is to implement this package by yourself. Then you would see that you would also have to use --no-tree-shake-icons.

This is not linked to this package honestly, but rather the fact, that you want to provide your user a set of Icons which could be used or not (So: a "Picker").

That's why you need this flag when building.

Ahmadre commented 1 year ago

For more see: https://github.com/flutter/flutter/issues/16311