从iconfont-阿里巴巴矢量图标库下载自己的选好的图标库
复制ttf文件到 fonts目录下,如:D:\dev\Android\apps\ichat\fonts\my_iconfont.ttf
在pubspec.yaml里面配置
flutter:  fonts:- family: my_iconfonts:- asset: fonts/my_icon_font.ttf定义IconData结构
class MyIcon {static const orange = IconData(0xe60b,  //对应ttf对应的json文件里面的 unicodefontFamily: "my_icon",//对应pubspec.yaml里面的familymatchTextDirection: true,);static const baoxian = IconData(0xe60c, //对应ttf对应的json文件里面的 unicodefontFamily: "my_icon",matchTextDirection: true,);static const dadou = IconData(0xe60d,  //对应ttf对应的json文件里面的 unicodefontFamily: "my_icon",matchTextDirection: true,);
}使用图标
class MyIconPage extends StatelessWidget {const MyIconPage({super.key});@overrideWidget build(BuildContext context) {return Scaffold(appBar: AppBar(title: const Text("MyIcon")),body: const Column(children:  [Icon(MyIcon.orange, size: 100, color: Colors.orange),Icon(MyIcon.baoxian, size: 100, color: Colors.yellow),Icon(MyIcon.dadou, size: 100, color: Colors.red),]),);}
}