set method
Asynchronously sets the contained value with reactive propagation.
This operation:
- Validates the new value against all test rules
- Updates the value if validation passes
- Propagates changes to all linked cells
- Returns a Future that completes when all notifications are processed
value
: The new value to set
Returns a Future<bool>
that completes with:
true
if the value was successfully updatedfalse
if validation failed or the collective is unmodifiable
Example:
final success = await asyncTemp.setValue(75.0);
if (success) print('Update succeeded');
Implementation
@override
Future<bool> set(V? value) async {
return Future<bool>(() {
if (this is! Unmodifiable) {
return _collective._setValue(value).isNotEmpty;
}
return false;
});
}