【发布时间】:2020-05-20 20:38:27
【问题描述】:
我有一个包含自定义对象的列表,并希望对其进行迭代并将值设置为 true/false。
看到了setAll 方法,但我不会只更改列表中每个对象的属性。
我的对象看起来像:
class Feature {
String id;
String title;
String subtitle;
IconData leftIcon;
IconData topRightIcon;
IconData bottomRightIcon;
bool isEnable;
Feature({this.title, this.subtitle, this.leftIcon, this.topRightIcon, this.bottomRightIcon, this.isEnable,this.id});
}
所以想要迭代的对象是:List<Feature> features;
在颤振中怎么可能?
【问题讨论】: