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