value property

E? value

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

Implementation

E? get value => _iterable.safeFirst;
void value=(E? newValue)

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? newValue) {
  if (value == null && newValue != null) {
    // addition
    super._addAll({newValue._key!});
    return;
  }
  if (value != null && newValue != null) {
    // update
    super._update(value!, newValue);
    return;
  }
  if (value != null && newValue == null) {
    // removal
    super._remove(value!);
    return;
  }
}