gpt4 book ai didi

flutter - iconfont :How to make iconfont work in flutter

转载 作者:IT王子 更新时间:2023-10-29 07:04:59 24 4
gpt4 key购买 nike

我在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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com