min property

T min

Get the minimum value of a collection of numbers

Implementation

T get min {
  if (isEmpty) {
    final String type = T.toString();
    if (type == 'int') return 0 as T;
    if (type == 'double') return 0.0 as T;
    if (type == 'num') return 0 as T;
  }
  if (length == 1) return first;
  sort();
  return first;
}