flutter - 如何在颤动中使用 book_outlined 图标?
问题描述
我想在颤动中使用“book_outlined”图标,但它没有出现在我的应用程序中。
book_outlined:https ://api.flutter.dev/flutter/material/Icons/book_outlined-constant.html
我尝试了两种方式,但总是出错。
// 1
Icon(Icons.book_outlined)
//2
Icon(IconData(0xe08f, fontFamily: 'MaterialIcons'))
The getter 'book_outlined' isn't defined for the type 'Icons'.
Try importing the library that defines 'book_outlined', correcting the name to the name of an existing getter, or defining a getter or field named 'book_outlined'
我的代码有什么错误吗?请给我一些建议好吗?
解决方案
如果更新您的 Flutter 版本没有帮助,那么您可以切换到主频道。我刚刚检查过,上面的图标在那里可用。要切换频道,只需键入命令:flutter channel master