void main() {
var numbers = [5, 10, -4, 27, -8, 6, -2];
var min1 = numbers.reduce((curr, next) => curr < next ? curr: next);
print("min1: ${min1}");
var min2 = numbers.where((number) => number > 0).reduce((curr, next) => curr < next ? curr: next);
print("min2: ${min2}");
}
Output
min1: -8
min2: 5