void main() {
var numbers = [5, 10, -4, 27, -8, 6, -2];
print("List 1");
numbers.where((number) => number > 0).forEach((number) {
print(number);
});
print("List 2");
numbers.where((number) => number % 2 == 0).forEach((number) {
print(number);
});
}
Output
List 1
5
10
27
6
List 2
10
-4
-8
6
-2