Enhancement request: A List method to return a new List containing a certain property of each List member. #15278
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-not-planned
Closed as we don't intend to take action on the reported issue
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by @xximranxx
Say you have a class:
class Basic {
int x;
Basic(this.x);
}
and a list of this class:
main() {
List<Basic> basic_list = [new Basic(1),new Basic(2)];
}
Now it would be nice to have a method to return a List of the x property of each List member:
main() {
List<Basic> basic_list = [new Basic(1),new Basic(2)];
List<int> int_list = basic_list.getPropertyList('x');
for(int tmp_x in int_list) {
print(tmp_x);
}
}
would output:
1
2
Thanks,
Imran
The text was updated successfully, but these errors were encountered: