NumericBloomElementsExtension<E extends num> extension

Reactive numeric aggregations and reduction extensions on BloomIterableElements.

Architectural Benefits

Extends numeric collections with high-efficiency arithmetic operations (sum, average, min, max). Calculations evaluate lazily on-demand when downstream consumers pull values.

Data Propagation Flow

[Source Bloom<Iterable<num>>]
       │ (Push-Dirty)
       ▼
[Numeric Aggregation Pipeline]
       ├─► .sum     ──► Arithmetic Sum Bloom<E>
       ├─► .average ──► Arithmetic Mean Bloom<double>
       ├─► .min     ──► Smallest value Bloom<E>
       └─► .max     ──► Largest value Bloom<E>

Examples

final scores = blooming<List<int>>([85, 92, 78]);
final totalScore = scores.bloom.elements.sum;
final avgScore = scores.bloom.elements.average;

print('Total: ${untracked(totalScore)}'); // 255
print('Avg: ${untracked(avgScore)}');     // 85.0
on

Properties

average → Bloom<double>

Available on BloomIterableElements<E>, provided by the NumericBloomElementsExtension extension

Returns the arithmetic average of all elements in this collection reactively.
no setter
max → Bloom<E>

Available on BloomIterableElements<E>, provided by the NumericBloomElementsExtension extension

Returns the maximum element in this collection, or throws StateError if empty.
no setter
maxOrNull → Bloom<E?>

Available on BloomIterableElements<E>, provided by the NumericBloomElementsExtension extension

Returns the maximum element in this collection, or null if empty.
no setter
min → Bloom<E>

Available on BloomIterableElements<E>, provided by the NumericBloomElementsExtension extension

Returns the minimum element in this collection, or throws StateError if empty.
no setter
minOrNull → Bloom<E?>

Available on BloomIterableElements<E>, provided by the NumericBloomElementsExtension extension

Returns the minimum element in this collection, or null if empty.
no setter
sum → Bloom<E>

Available on BloomIterableElements<E>, provided by the NumericBloomElementsExtension extension

Returns the sum of all elements in this collection reactively.
no setter