create<V, I extends Iterable<V>> static method

CollectiveValue<V> create<V, I extends Iterable<V>>({
  1. V? value,
  2. bool unmodifiableElement = true,
  3. Cell? bind,
  4. ContainerType? container,
  5. CollectiveReceptor<dynamic, Signal, Signal> receptor = CollectiveReceptor.unchanged,
  6. TestCollective<dynamic, Collective> test = TestCollective.passed,
  7. MapObject? mapObject,
  8. Synapses<Signal, Cell> synapses = Synapses.enabled,
  9. bool setter(
    1. CollectiveValue<V> value,
    2. I container,
    3. V? v
    )?,
  10. V? getter(
    1. CollectiveValue<V> value,
    2. I container
    )?,
})
override

Factory constructor for creating unmodifiable values with full configuration.

Parameters:

  • value: Initial value
  • unmodifiableElement: If true and value contains Cell objects, makes them unmodifiable
  • bind: Cell to bind to
  • container: Container type
  • receptor: Signal receptor
  • test: Validation rules
  • map: Value transformations
  • synapses: Connection configuration
  • setter: Custom setter function
  • getter: Custom getter function

Implementation

static CollectiveValue<V> create<V, I extends Iterable<V>>({
  V? value,
  bool unmodifiableElement = true,
  Cell? bind,
  ContainerType? container,
  CollectiveReceptor receptor = CollectiveReceptor.unchanged,
  TestCollective test = TestCollective.passed,
  MapObject? mapObject,
  Synapses synapses = Synapses.enabled,
  bool Function(CollectiveValue<V> value, I container, V? v)? setter,
  V? Function(CollectiveValue<V> value, I container)? getter,
}) {
  return UnmodifiableCollectiveValue<V>.fromProperties(_CollectiveValueProperties<V,I>(
      bind: bind,
      container: container ?? ContainerType.value,
      test: test,
      receptor: receptor,
      synapses: synapses,
      setter: setter,
      getter: getter
  ), unmodifiableElement: unmodifiableElement, value: value);
}