GeneralBloomElementsExtension<E> extension
Reactive extensions on BloomIterableElements providing collection utilities.
Architectural Benefits
All transformation methods (such as sorted, shuffled, whereNot, slices, groupListsBy) compute lazily and return immutable List.unmodifiable collections to prevent unexpected side-effects and preserve reactive state isolation.
Data Propagation Flow
[Source Bloom<Iterable<E>>]
│ (Push-Dirty)
▼
[Grouping & Slicing Operator Pipeline]
├─► .slices(3) ──► Chunked Bloom<List<List<E>>>
├─► .groupListsBy(key) ──► Grouped Bloom<Map<K, List<E>>>
├─► .sample(n) ──► Randomized Bloom<List<E>>
└─► .sortedBy(key) ──► Sorted Bloom<List<E>>
Examples
final numbers = blooming([1, 2, 3, 4, 5, 6, 7]);
final chunks = numbers.bloom.elements.slices(3);
final evenOdd = numbers.bloom.elements.groupListsBy((n) => n % 2 == 0 ? 'even' : 'odd');
print(untracked(chunks)); // [[1, 2, 3], [4, 5, 6], [7]]
print(untracked(evenOdd)); // {'odd': [1, 3, 5, 7], 'even': [2, 4, 6]}
- on
Methods
-
anyIndexed(
bool test(int index, E element)) → Bloom< bool> -
Available on BloomIterableElements<
ReturnsE> , provided by the GeneralBloomElementsExtension extensiontrueif any element satisfies an indexed predicatetestreactively. -
elementAtOrNull(
int index) → Bloom< E?> -
Available on BloomIterableElements<
Returns theE> , provided by the GeneralBloomElementsExtension extensionindexth element reactively, ornullif out of range. -
everyIndexed(
bool test(int index, E element)) → Bloom< bool> -
Available on BloomIterableElements<
ReturnsE> , provided by the GeneralBloomElementsExtension extensiontrueif all elements satisfy an indexed predicatetestreactively. -
expandIndexed<
T> (Iterable< T> toElements(int index, E element)) → Bloom<List< T> > -
Available on BloomIterableElements<
Flattens this collection along with element indices reactively.E> , provided by the GeneralBloomElementsExtension extension -
firstWhereIndexedOrNull(
bool test(int index, E element)) → Bloom< E?> -
Available on BloomIterableElements<
Returns the first element that satisfies an indexed predicateE> , provided by the GeneralBloomElementsExtension extensiontestreactively, ornullif none. -
firstWhereOrNull(
bool test(E element)) → Bloom< E?> -
Available on BloomIterableElements<
Returns the first element that satisfiesE> , provided by the GeneralBloomElementsExtension extensiontestreactively, ornullif none. -
foldIndexed<
T> (T initialValue, T combine(int index, T previous, E element)) → Bloom< T> -
Available on BloomIterableElements<
Reduces this collection to a single value by iteratively combining elements along with their index and an initial value reactively.E> , provided by the GeneralBloomElementsExtension extension -
groupBy<
K> (K key(E element)) → Bloom< Map< K, List< >E> > -
Available on BloomIterableElements<
Legacy alias of groupListsBy.E> , provided by the GeneralBloomElementsExtension extension -
groupFoldBy<
K, G> ({required K key(E element), required G fold(G? previous, E element)}) → Bloom< Map< K, G> > -
Available on BloomIterableElements<
Groups and folds elements by a key computed from each element reactively.E> , provided by the GeneralBloomElementsExtension extension -
groupListsBy<
K> (K keyOf(E element)) → Bloom< Map< K, List< >E> > -
Available on BloomIterableElements<
Groups elements into lists byE> , provided by the GeneralBloomElementsExtension extensionkeyOfreactively. -
groupSetsBy<
K> (K keyOf(E element)) → Bloom< Map< K, Set< >E> > -
Available on BloomIterableElements<
Groups elements into sets byE> , provided by the GeneralBloomElementsExtension extensionkeyOfreactively. -
isSorted(
int compare(E a, E b)) → Bloom< bool> -
Available on BloomIterableElements<
ReturnsE> , provided by the GeneralBloomElementsExtension extensiontrueif this collection is sorted bycomparereactively. -
isSortedBy<
K extends Comparable> (K keyOf(E element)) → Bloom< bool> -
Available on BloomIterableElements<
ReturnsE> , provided by the GeneralBloomElementsExtension extensiontrueif this collection is sorted by the natural order ofkeyOfreactively. -
isSortedByCompare<
K> (K keyOf(E element), int compare(K a, K b)) → Bloom< bool> -
Available on BloomIterableElements<
ReturnsE> , provided by the GeneralBloomElementsExtension extensiontrueif this collection is sorted bycompareofkeyOfreactively. -
lastBy<
K> (K key(E element)) → Bloom< Map< K, E> > -
Available on BloomIterableElements<
Groups elements byE> , provided by the GeneralBloomElementsExtension extensionkeyreactively, keeping only the last element for each key. -
lastWhereIndexedOrNull(
bool test(int index, E element)) → Bloom< E?> -
Available on BloomIterableElements<
Returns the last element that satisfies an indexed predicateE> , provided by the GeneralBloomElementsExtension extensiontestreactively, ornullif none. -
lastWhereOrNull(
bool test(E element)) → Bloom< E?> -
Available on BloomIterableElements<
Returns the last element that satisfiesE> , provided by the GeneralBloomElementsExtension extensiontestreactively, ornullif none. -
mapIndexed<
T> (T convert(int index, E element)) → Bloom< List< T> > -
Available on BloomIterableElements<
Maps each element of this collection along with its index reactively.E> , provided by the GeneralBloomElementsExtension extension -
none(
bool test(E element)) → Bloom< bool> -
Available on BloomIterableElements<
ReturnsE> , provided by the GeneralBloomElementsExtension extensiontrueif no elements satisfytestreactively. -
noneIndexed(
bool test(int index, E element)) → Bloom< bool> -
Available on BloomIterableElements<
ReturnsE> , provided by the GeneralBloomElementsExtension extensiontrueif no elements satisfy an indexed predicatetestreactively. -
reduceIndexed(
E combine(int index, E previous, E element)) → Bloom< E> -
Available on BloomIterableElements<
Reduces this collection to a single value by iteratively combining elements along with their index reactively.E> , provided by the GeneralBloomElementsExtension extension -
sample(
int count, [Random? random]) → Bloom< List< E> > -
Available on BloomIterableElements<
SelectsE> , provided by the GeneralBloomElementsExtension extensioncountelements at random from this collection reactively. -
shuffled(
[Random? random]) → Bloom< List< E> > -
Available on BloomIterableElements<
Returns a list containing the elements of this collection shuffled reactively.E> , provided by the GeneralBloomElementsExtension extension -
singleWhereIndexedOrNull(
bool test(int index, E element)) → Bloom< E?> -
Available on BloomIterableElements<
Returns the single element that satisfies an indexed predicateE> , provided by the GeneralBloomElementsExtension extensiontestreactively, ornullif none. -
singleWhereOrNull(
bool test(E element)) → Bloom< E?> -
Available on BloomIterableElements<
Returns the single element that satisfiesE> , provided by the GeneralBloomElementsExtension extensiontestreactively, ornullif none. -
slices(
int size) → Bloom< List< List< >E> > -
Available on BloomIterableElements<
Splits this collection into chunks ofE> , provided by the GeneralBloomElementsExtension extensionsizeelements reactively. -
sorted(
int compare(E a, E b)) → Bloom< List< E> > -
Available on BloomIterableElements<
Returns a list containing the elements of this collection sorted byE> , provided by the GeneralBloomElementsExtension extensioncomparereactively. -
sortedBy<
K extends Comparable> (K keyOf(E element)) → Bloom< List< E> > -
Available on BloomIterableElements<
Returns a list containing the elements of this collection sorted byE> , provided by the GeneralBloomElementsExtension extensionkeyOfreactively. -
sortedByCompare<
K> (K keyOf(E element), int compare(K a, K b)) → Bloom< List< E> > -
Available on BloomIterableElements<
Returns a list containing the elements of this collection sorted byE> , provided by the GeneralBloomElementsExtension extensioncompareofkeyOfreactively. -
splitAfter(
bool test(E element)) → Bloom< List< List< >E> > -
Available on BloomIterableElements<
Splits this collection after elements satisfyingE> , provided by the GeneralBloomElementsExtension extensiontestreactively. -
splitAfterIndexed(
bool test(int index, E element)) → Bloom< List< List< >E> > -
Available on BloomIterableElements<
Splits this collection into chunks after elements satisfying an indexed predicateE> , provided by the GeneralBloomElementsExtension extensiontestreactively. -
splitBefore(
bool test(E element)) → Bloom< List< List< >E> > -
Available on BloomIterableElements<
Splits this collection into chunks before elements satisfyingE> , provided by the GeneralBloomElementsExtension extensiontestreactively. -
splitBeforeIndexed(
bool test(int index, E element)) → Bloom< List< List< >E> > -
Available on BloomIterableElements<
Splits this collection into chunks before elements satisfying an indexed predicateE> , provided by the GeneralBloomElementsExtension extensiontestreactively. -
splitBetween(
bool test(E first, E second)) → Bloom< List< List< >E> > -
Available on BloomIterableElements<
Splits this collection into chunks between elements satisfyingE> , provided by the GeneralBloomElementsExtension extensiontestreactively. -
splitBetweenIndexed(
bool test(int index, E first, E second)) → Bloom< List< List< >E> > -
Available on BloomIterableElements<
Splits this collection into chunks between elements satisfying an indexed predicateE> , provided by the GeneralBloomElementsExtension extensiontestreactively. -
whereIndexed(
bool test(int index, E element)) → Bloom< List< E> > -
Available on BloomIterableElements<
Filters elements of this collection based on an indexed predicateE> , provided by the GeneralBloomElementsExtension extensiontestreactively. -
whereNot(
bool test(E element)) → Bloom< List< E> > -
Available on BloomIterableElements<
Returns a list of elements that do not satisfyE> , provided by the GeneralBloomElementsExtension extensiontestreactively. -
whereNotIndexed(
bool test(int index, E element)) → Bloom< List< E> > -
Available on BloomIterableElements<
Filters elements of this collection based on an indexed predicateE> , provided by the GeneralBloomElementsExtension extensiontestreactively, returning those that do not satisfy it.