[英]Creating an icon widget with all icon import
根據您構建的 Widget,我認為您不需要定義customIcon
列表。
在您的CustomIcon
小部件中,只需將IconData
傳遞給type
。
例子
import "package:flutter_feather_icons/flutter_feather_icons.dart";
CustomIcon(type: FeatherIcons.github)
如果您想使用您的customIcon
以便您不必再次導入包,您可以這樣做
CustomIcon(type: customIcon.FeatherIcons.github)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.