我正在尝试添加一个自定义图标,但它不起作用,它只是没有显示在屏幕上。告诉我我的错误是什么以及如何解决?
我的配置-
class CustomIcons {
CustomIcons._();
static const _kFontFam = 'MyFlutterApp';
static const String? _kFontPkg = null;
static const IconData airline_seat_recline_normal = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData map_marker = IconData(0xe833, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData sliders = IconData(0xf1de, fontFamily: _kFontFam, fontPackage: _kFontPkg);
}
pubsec.yamal-
- family: CustomIcons
fonts:
- asset: fonts/Icon-Place.ttf
我这样使用- Icon(CustomIcons.sliders)