CollectiveValue<V> constructor

CollectiveValue<V>(
  1. V? value, {
  2. Cell? bind,
  3. TestCollective<dynamic, Collective> test,
  4. SignalTransform<Cell, Signal, Signal>? transform,
})

Creates a reactive single value container

@param value: Initial value @param bind: Cell to bind to @param test: Validation rules

// Example: final currentUser = CollectiveValue<User?>( User(name: 'Alice'), test: TestCollective.create( elementDisallow: (user, _) => user == null ) );

// Update reactively currentUser.value = User(name: 'Bob');

Implementation

factory CollectiveValue(V? value, {
  Cell? bind,
  TestCollective test,
  SignalTransform? transform,
}) = _CollectiveValue<V>;