ListBloomElementsExtension<E> extension

Reactive extensions on BloomListElements providing high-performance list operations.

Architectural Benefits

All transformations operating on BloomListElements return new reactive Bloom nodes. List-producing operations immediately wrap returned lists with List.unmodifiable to guarantee state immutability across reactive cycles.

Data Propagation Flow

[Source Bloom<List<E>>]
       │ (Push-Dirty)
       ▼
[Reactive List Extension Operators]
       ├─► .binarySearch(target) ──► Reactive Index Bloom<int> (O(log N))
       ├─► .sortedRange(0, 5)    ──► Immutable Sub-range Sorted Bloom<List<E>>
       ├─► .swapped(i, j)        ──► Immutable Swapped Bloom<List<E>>
       └─► .slices(pageSize)     ──► Paginated Bloom<List<List<E>>>

Examples

final listController = blooming<List<int>>([10, 20, 30, 40, 50]);
final indexBloom = listController.bloom.elements.binarySearch(30, (a, b) => a.compareTo(b));
final swappedList = listController.bloom.elements.swapped(0, 4);

print(untracked(indexBloom)); // 2
on

Methods

binarySearch(E element, int compare(E a, E b)) → Bloom<int>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns the index of element in this sorted list via binary search.
binarySearchBy<K extends Comparable>(E element, K keyOf(E element), [int start = 0, int? end]) → Bloom<int>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns the index of element in this sorted list by key natural order.
binarySearchByCompare<K>(E element, K keyOf(E element), int compare(K a, K b), [int start = 0, int? end]) → Bloom<int>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns the index of element in this sorted list by comparing key extracted via keyOf.
elementAtOrNull(int index) → Bloom<E?>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns the indexth element reactively, or null if out of range.
equals(List<E> other, [Equality<E> equality = const DefaultEquality()]) → Bloom<bool>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Whether other has the same elements as this list reactively.
lowerBound(E element, int compare(E a, E b)) → Bloom<int>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns the index where element should be inserted in this sorted list.
lowerBoundBy<K extends Comparable>(E element, K keyOf(E element), [int start = 0, int? end]) → Bloom<int>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns the index where element should be inserted by key natural order.
lowerBoundByCompare<K>(E element, K keyOf(E element), int compare(K a, K b), [int start = 0, int? end]) → Bloom<int>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns the index where element should be inserted by comparing key extracted via keyOf.
reversedRange(int start, int end) → Bloom<List<E>>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns a new unmodifiable list with a range of elements reversed reactively.
shuffledRange(int start, int end, [Random? random]) → Bloom<List<E>>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns a new unmodifiable list with a range of elements shuffled reactively.
slice(int start, [int? end]) → Bloom<List<E>>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns a sublist of this list reactively.
slices(int length) → Bloom<List<List<E>>>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Contiguous slices of this list with the given length reactively.
sortedBy<K extends Comparable>(K keyOf(E element), [int start = 0, int? end]) → Bloom<List<E>>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns a new unmodifiable list containing elements sorted by key extracted via keyOf.
sortedByCompare<K>(K keyOf(E element), int compare(K a, K b), [int start = 0, int? end]) → Bloom<List<E>>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns a new unmodifiable list containing elements sorted by compare of key extracted via keyOf.
sortedRange(int start, int end, int compare(E a, E b)) → Bloom<List<E>>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns a new unmodifiable list containing a sorted range of elements from this list.
swapped(int index1, int index2) → Bloom<List<E>>

Available on BloomListElements<E>, provided by the ListBloomElementsExtension extension

Returns a new unmodifiable list with two elements swapped reactively.