average property
Returns the arithmetic average of all elements in this collection reactively.
Requires:
- The collection MUST NOT be empty.
Throws:
- StateError if the collection is empty upon evaluation.
Implementation
Bloom<double> get average => computed((via) {
final source = via(bloom);
if (source.isEmpty) throw StateError('No element');
return source.average;
});