min property

Bloom<E> get min

Returns the minimum element in this collection, or throws StateError if empty.

Requires:

  • The source collection MUST NOT be empty.

Throws:

  • StateError if the collection is empty upon evaluation.

Implementation

Bloom<E> get min => computed((via) {
      final source = via(bloom);
      if (source.isEmpty) throw StateError('No element');
      return source.reduce((a, b) => a.compareTo(b) < 0 ? a : b);
    });