Flutter - 找不到某些图标
我正在尝试使用 Icon(Icons.factory)
但它没有显示:在 VSCode 中,甚至在我的应用程序中。
你知道为什么吗? (我看到我需要添加 font_awesome_flutter
或 material_design_icons_flutter
但它是强制性的吗?)
我正在使用 cupertino_icons: ^1.0.4
& uses-material-design: true
在我的 pubspec.yaml
I'm trying to use Icon(Icons.factory)
but it not displayed: in VSCode and even in my app.
Do you know why? (I saw I need to add font_awesome_flutter
or material_design_icons_flutter
but is it mandatory?)
I'm using cupertino_icons: ^1.0.4
& uses-material-design: true
in my pubspec.yaml
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 cupertino 文档中没有看到任何名为 factory 的图标,但如果您想添加 ide 选项中尚未存在的任何图标,只需访问 flutters cupetino 文档并单击您想要的图标即可想。例如,选项中尚不可用的 paperlane 图标
static const IconData paperplane = IconData(0xf733, fontFamily: iconFont, fontPackage: iconFontPackage);
将上面的代码更改为
static const IconData paperplane = IconData(0xf733, fontFamily: CupertinoIcons.iconFont, fontPackage: CupertinoIcons.iconFontPackage);
那么你可以在代码中使用字体作为
Icon(paperplane)
请记住更新你的 cupertino 包并导入文件以使某些图标可以工作
I haven't seen any icon with name factory in the cupertino documentation but if you want to add any icon which is not yet present in your ide's options, simply visit flutters cupetino docs and click on the icon you want. For example the paperlane icon which is not yet available in the options
static const IconData paperplane = IconData(0xf733, fontFamily: iconFont, fontPackage: iconFontPackage);
change above code to
static const IconData paperplane = IconData(0xf733, fontFamily: CupertinoIcons.iconFont, fontPackage: CupertinoIcons.iconFontPackage);
then you can use the font in your code as
Icon(paperplane)
Remember to update your cupertino package and import the file for some icons to work