set method

  1. @override
Future<bool> set(
  1. V? value
)
override

Asynchronously sets the contained value with reactive propagation.

This operation:

  1. Validates the new value against all test rules
  2. Updates the value if validation passes
  3. Propagates changes to all linked cells
  4. 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 updated
  • false 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;
  });
}