Kar*_*rar 11 font-awesome flutter
我目前正在做一个副项目,当我在我的应用程序中包含一个字体很棒的图标时,它没有显示出来,而是一个空白框,两条线像字母 x 一样相互交叉,如何解决这个问题?
class ImageHoldingComponent extends StatefulWidget {
@override
_ImageHoldingComponentState createState() =>
_ImageHoldingComponentState();
Run Code Online (Sandbox Code Playgroud)
}
class _ImageHoldingComponentState extends State<ImageHoldingComponent> {
@override
Widget build(BuildContext context) {
return Container(
child: Icon(FontAwesomeIcons.python)
);
}
}
Run Code Online (Sandbox Code Playgroud)
小智 6
当您开始使用旧版本的 font_awesome_flutter 时,就会发生这种情况,因为虚拟设备缓存是在构建 Flutter 应用程序时存储的,因此每次更改图标时,您都必须停止模拟器并重建它。
我的经验是:
停止main.dart(Android 模拟器)
添加pubspec.yaml(font_awesome_flutter)新版本
font_awesome_flutter:^8.8.1
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
font_awesome_flutter: ^8.8.1 //new verison
Run Code Online (Sandbox Code Playgroud)
然后单击
“酒吧得到”
在 Flutter 命令的顶部
| 归档时间: |
|
| 查看次数: |
15480 次 |
| 最近记录: |