min method
T
min()
Finds minimum value.
Throws StateError if the iterable is empty.
Implementation
T min() {
T? result;
for (var item in this) {
if (result == null || item.compareTo(result) < 0) {
result = item;
}
}
if (result == null) {
throw StateError('Iterable is empty');
}
return result;
}