CollectiveValueAsync<V> class
An asynchronous wrapper for CollectiveValue operations that provides Future-based APIs.
This class enables non-blocking access to a reactive value container while maintaining all the reactive properties of the underlying CollectiveValue. All mutating operations return Future objects, making them safe to use in asynchronous contexts.
Usage Example
final temperature = CollectiveValue<double>(72.5);
final asyncTemp = temperature.async; // Get async wrapper
// Asynchronous value update
await asyncTemp.setValue(75.0);
Key Features
- Thread-safe value updates via Futures
- Maintains reactive binding to parent cells
- Preserves all validation rules from the source CollectiveValue
- Seamless integration with async/await patterns
- Inheritance
-
- Object
- CellAsync<
CollectiveValue< V> > - CollectiveAsync<
V, CollectiveValue< V> > - CollectiveValueAsync
- Implemented types
- Implementers
- Available extensions
Constructors
-
CollectiveValueAsync.new(CollectiveValue<
V> collective) -
Creates an async wrapper around an existing CollectiveValue.
const
Properties
-
async
→ CollectiveValueAsync<
V> -
Creates a Async CollectiveValue for async modifiable operations
no setteroverride
- first → V
-
The first element.
no setterinherited
- firstOrNull → T?
-
Available on Iterable<
The first element of this iterator, orT> , provided by the IterableExtensions extensionnull
if the iterable is empty.no setter - hashCode → int
-
The hash code for this object.
no setteroverride
-
indexed
→ Iterable<
(int, T)> -
Available on Iterable<
Pairs of elements of the indices and elements of this iterable.T> , provided by the IterableExtensions extensionno setter - isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
V> -
A new
Iterator
that allows iterating the elements of thisIterable
.no setterinherited - last → V
-
The last element.
no setterinherited
- lastOrNull → T?
-
Available on Iterable<
The last element of this iterable, orT> , provided by the IterableExtensions extensionnull
if the iterable is empty.no setter - length → int
-
The number of elements in this Iterable.
no setterinherited
-
modifiable
→ Iterable<
Function> -
Returns an iterable containing modifiable functions.
no setterinherited
-
nonNulls
→ Iterable<
T> -
Available on Iterable<
The non-T?> , provided by the NullableIterableExtensions extensionnull
elements of this iterable.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → V
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
- singleOrNull → T?
-
Available on Iterable<
The single element of this iterator, orT> , provided by the IterableExtensions extensionnull
.no setter -
test
→ TestCollective<
dynamic, Collective> -
Gets the test object associated with the cell.
no setteroverride
-
unmodifiable
→ CollectiveValue<
V> -
Gets an unmodifiable view of this value.
no setteroverride
- value ↔ V?
-
The value of this CollectiveValue
getter/setter pairoverride
-
wait
→ Future<
List< T> > -
Available on Iterable<
Waits for futures in parallel.Future< , provided by the FutureIterable extensionT> >no setter
Methods
-
any(
bool test(V element)) → bool -
Checks whether any element of this iterable satisfies
test
.inherited -
apply(
Function function, List? positionalArguments, [Map< Symbol, dynamic> ? namedArguments]) → Future -
Asynchronously applies a function through the cell's validation system.
inherited
-
asNameMap(
) → Map< String, T> -
Available on Iterable<
Creates a map from the names of enum values to the values.T> , provided by the EnumByName extension -
byName(
String name) → T -
Available on Iterable<
Finds the enum value in this list with nameT> , provided by the EnumByName extensionname
. -
cast<
R> () → Iterable< R> -
A view of this iterable as an iterable of
R
instances.inherited -
contains(
Object? element) → bool -
Whether the collection contains an element equal to
element
.inherited -
deputy(
{covariant TestCollective< dynamic, Collective> ? test, covariant MapObject? mapObject}) → CollectiveValue<V> -
Creates a delegated view with modified behavior.
override
-
elementAt(
int index) → V -
Returns the
index
th element.inherited -
elementAtOrNull(
int index) → T? -
Available on Iterable<
The element at positionT> , provided by the IterableExtensions extensionindex
of this iterable, ornull
. -
every(
bool test(V element)) → bool -
Checks whether every element of this iterable satisfies
test
.inherited -
expand<
T> (Iterable< T> toElements(V element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
firstWhere(
bool test(V element), {V orElse()?}) → V -
The first element that satisfies the given predicate
test
.inherited -
fold<
T> (T initialValue, T combine(T previousValue, V element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
Iterable< V> other) → Iterable<V> -
Creates the lazy concatenation of this iterable and
other
.inherited -
forEach(
void action(V element)) → void -
Invokes
action
on each element of this iterable in iteration order.inherited -
join(
[String separator = ""]) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastWhere(
bool test(V element), {V orElse()?}) → V -
The last element that satisfies the given predicate
test
.inherited -
map<
T> (T toElement(V e)) → Iterable< T> -
The current elements of this iterable modified by
toElement
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reduce(
V combine(V value, V element)) → V -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
set(
V? value) → Future< bool> -
Asynchronously sets the contained value with reactive propagation.
override
-
singleWhere(
bool test(V element), {V orElse()?}) → V -
The single element that satisfies
test
.inherited -
skip(
int count) → Iterable< V> -
Creates an Iterable that provides all but the first
count
elements.inherited -
skipWhile(
bool test(V value)) → Iterable< V> -
Creates an
Iterable
that skips leading elements whiletest
is satisfied.inherited -
take(
int count) → Iterable< V> -
Creates a lazy iterable of the
count
first elements of this iterable.inherited -
takeWhile(
bool test(V value)) → Iterable< V> -
Creates a lazy iterable of the leading elements satisfying
test
.inherited -
toList(
{bool growable = true}) → List< V> -
Creates a List containing the elements of this Iterable.
inherited
-
toSet(
) → Set< V> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
where(
bool test(V element)) → Iterable< V> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test
.inherited -
whereType<
T> () → Iterable< T> -
Creates a new lazy Iterable with all elements that have type
T
.inherited
Operators
-
operator <(
Object other) → bool -
Comparison operators for numeric values
override
-
operator <=(
Object other) → bool -
Comparison operators for numeric values
override
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator >(
Object other) → bool -
Comparison operators for numeric values
override