Reputation: 141
Lets say I have a stream of persons and I want to filter them by the age being >= 40. I know that in Java I can do something like this:
lp.stream().filter(p->p.getAKge()>=40).forEach(System.out::println);
I'm new to dart so I don't really know what would be the equivalent of this functionality in this language.
Upvotes: 0
Views: 196
Reputation: 56393
Except slight syntax differences use where
on the source and job done.
lp.where((p) => p.getAge() >= 40).forEach((p) => print(p));
Upvotes: 1