CollectiveValue<V> constructor
CollectiveValue<V> (
- V? value, {
- Cell? bind,
- TestCollective<
dynamic, Collective> test, - 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>;