value property

E? value

Obtains the single E value of this relationship (null if not present).

Implementation

E? get value => first;
void value=(E? value)

Sets the single E value of this relationship, replacing any previous value.

Passing in null will remove the existing value from the relationship.

Implementation

set value(E? value) {
  if (this.value != null || value == null) {
    super.remove(this.value!);
  }
  if (value != null) {
    super.add(value);
  }
  assert(length <= 1);
}