class MyApp extends StatelessWidget { const MyApp({Key key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'Icon字体图标', home: Scaffold( appBar: AppBar( title: Text('Icon字体图标'), ), body: Column( children: [ Icon( //这里的Icons其实就是Material内置的字体图标 // Icons.favorite, --------> 等同于 IconData(0xe87d, fontFamily: 'MaterialIcons', matchTextDirection: true) IconData( //code 0xe87d, //字体,在pubspec.yaml定义 fontFamily: 'MaterialIcons', matchTextDirection: true), ), Icon( IconData( //code 61447, //字体,在pubspec.yaml定义 fontFamily: 'FontAwesome', ), size: 40.0, ), ], ), ), ); } }
部分素材资源来源网站,本站提供免费下载,如有侵权请联系站长马上删除!