max property

Bloom<int> get max

Returns the maximum integer in this collection, or throws StateError if empty.

Requires:

  • The collection MUST NOT be empty.

Throws:

  • StateError if the collection is empty upon evaluation.

Implementation

Bloom<int> get max => computed((via) {
      final source = via(bloom);
      if (source.isEmpty) throw StateError('No element');
      return source.max;
    });