我在flutter中使用了iconfont,但是不能正常使用,
它看起来像一个“X”like this
我在pubsepc.yaml中定义:
flutter:
uses-material-design: true
fonts:
- family: iconfont
fonts:
- asset: assets/fonts/iconfont.ttf
这就是我使用它的方式:
MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('data'),),
body: Center(
child: Container(child: Icon(IconData(0xe60d,fontFamily: 'iconfont'),color: Colors.amber,size: 50.0,),)
),
),
),
iconfont.ttf中已经定义了“0xe60d”,我尝试将其替换为另一个定义的图标,但也没用
谁能帮帮我?真诚的感谢
最佳答案
使用此工具生成您的图标字体:http://fluttericon.com/
关于flutter - iconfont :How to make iconfont work in flutter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53967600/