wuba / Fair

A Flutter package used to update widget tree dynamically. Fair提供一整套Flutter动态化解决方案
https://fair.58.com
BSD 3-Clause "New" or "Revised" License
2.61k stars 310 forks source link

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

Open cinsondev opened 1 year ago

cinsondev commented 1 year ago

环境: fair 3.0.0

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

暂时加上--no-tree-shake-icons规避了一下,但是还是fair本身要解决一下这个问题

KKProject commented 1 year ago

目前fair动态化是通过解析JOSN节点在运行时创建Widget的方式实现的,所以创建的Widget的参数都是在运行时才确定,这也导致创建的widget无法声明为const。这个问题我们在后续会想办法做兼容处理,现阶段只能通过--no-tree-shake-icons规避

zmtzawqlp commented 1 year ago

https://github.com/wuba/Fair/pull/253 最新的已经移除掉了