- edited description
Flutter 1.20.1 -> cannot use tree shake icons fonts
New future that got enabled by default in flutter 1.20.1 release.
This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations
- file:///XXX/hosted/pub.dartlang.org/flutter_treeview-0.5.0+1/lib/src/models/node_icon.dart:82:24
Comments (12)
-
reporter -
same issue here
This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:
- file:///Users/sadra/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_treeview-0.4.2+1/lib/src/models/node_icon.dart:66:24
- file:///Users/sadra/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_treeview-0.4.2+1/lib/src/models/node_icon.dart:82:24
-
I am looking into this issue.
-
I am working to find a solution. In the meantime, you can turn off the tree shaking by passing the build argument as follows:
flutter build ios --no-tree-shake-icons
-
reporter Thank you for the update
-
Hi @Kevin Armstrong I still encounter this issue. Has this been fixed or in the mean time still use --no-tree-shake-icons?
-
reporter I’ve been digging into this issue a bit more because it limits my workflow to easily upload my builds to Testflight. What is the advantage of dynamically generating the NodeIcon based on a map instead of passing a regular Icon with its IconData?
-
reporter Update: I’ve managed to modify the library to only include IconData as part of the NodeIcon instead of dynamically generating this. Not sure if you want me to create a PR or you will re-create the changes yourself.
-
I created the NodeIcon this way so that its state can be easily serialized and deserialized with the rest of the TreeView data. I know a number of users who use this feature to build the TreeView with icons directly from the server. Limiting this to just passing in the IconData would remove this capability.
I’ve have very little time in the past few weeks to find a solution. My apologies. If you can share your solution, I can review it to see if it I can make it work.
-
@Albert-Jan Plate any chance you can create a PR so @Kevin Armstrong can update the library
-
Issue
#20was marked as a duplicate of this issue. -
- changed status to resolved
Refactored Node class to use IconData for the icon property. Removed NodeIcon class.
- Log in to comment