flutter - iconfont :How to make iconfont work in flutter

标签 flutter fonts

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

相关文章:

python - 如何在 PIL.ImageFont 中使用我自己的位图字体?

flutter - 在 Flutter 应用中立即显示应用主题

flutter - 未处理的异常:RangeError:值不在范围内:22

android - 如何在 flutter 中为 facebook 生成 key 哈希

c# - Winform webbrowser 自定义字体不显示

java - 如何找出 Java 7 和 8 中的字体文件路径

android - 整个应用程序的自定义字体

asynchronous - Flutter:Dialog 是否位于 Navigator(堆栈)之上?

dart - 如何从 FireStore 中排序列表

fonts - 从.ttf生成.afm