【发布时间】:2022-12-04 11:37:33
【问题描述】:
I am using a library that requires an icon of type package:flutter/src/widgets/icon_data.dart aka IconData. I\'d like to use my own .png file asset as an icon. I googled for solutions and everybody points out to the usage of ImageIcon. However when using this - the following error appears:
CircularMenuItem(
iconColor: GuiColors.textLight,
color: GuiColors.primary,
icon: ImageIcon(AssetImage(\"assets/icons/sword.png\")),
onTap: () {
//callback
}),
The error is:
The argument type \'ImageIcon\' can\'t be assigned to the parameter type \'IconData?\'. (Documentation)
标签: flutter dart flutter-image