【发布时间】:2019-02-07 09:42:11
【问题描述】:
假设我有一堂课:
class Icons {
static const IconData threesixty = IconData(0xe577, fontFamily: 'MaterialIcons');
}
现在我有一个值为“threesixty”的字符串变量:
String fieldName = "threesixty";
如何通过 fieldName 变量获取 Icons 类中的threesixty 的值?
我正在使用 reflectable 包,并且已经在 Flutter 中使用过 ClassMirrors 的其他功能,但不知道如何执行此操作。
【问题讨论】:
标签: reflection dart flutter dart-mirrors