[英]How to use flutter font awesome icons?
I have import dependencies called flutter_font_awesome
updated version from here我从这里导入了名为
flutter_font_awesome
更新版本的依赖flutter_font_awesome
but unfortunately when I tried then does not show any icon.但不幸的是,当我尝试时,没有显示任何图标。
I have tried like this way:我试过这样:
dependencies:
font_awesome_flutter: ^9.1.0
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
Expanded(
child: ReusableCard(
color: activeCardColor,
cardChild: Column(
children: <Widget>[
// Icon(
// FontAwesomeIcons.mars,
// size: 80.0,
// ),
IconButton(
// Use the FaIcon Widget + FontAwesomeIcons class for the IconData
icon: FaIcon(FontAwesomeIcons.mars),
onPressed: () {
print("Pressed");
}),
SizedBox(
height: 15.0,
),
Text(
'MALE',
style: TextStyle(
fontSize: 18.0,
color: Color(0xFF8D8E98),
),
),
],
),
),
),
I have stop and restarted the code already but still the same problem.我已经停止并重新启动了代码,但仍然是同样的问题。
Any suggestion please.请提出任何建议。
Try尝试
flutter clean
after this在这之后
flutter pub get
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.