当我使用命令
--tree-shake-icons
将 flutter 构建到 Web 平台时,我收到此错误。
This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:
file:///Users/xxx/Documents/flutter/packages/flutter/lib/src/widgets/icon_data.dart:22:9
file:///Users/xxx/Documents/hxgy/flutter/projectName/lib/utils/font_util/font_utils.dart:13:7
Target web_-release_bundle failed: Exception: Avoid non-constant invocations of IconData or try to build again with
--no-tree-shake-icons.
我需要flutter自动压缩字体图标的大小,因为图标太大,所以我没有使用
--no-tree-shake-icons
指挥官。