addValue method Null safety

LDValueObjectBuilder addValue(
  1. String key,
  2. LDValue? value
)

Associated the given key and LDValue in the builder.

Implementation

LDValueObjectBuilder addValue(String key, LDValue? value) {
  if (_copyOnWrite) {
    _builder = new Map.of(_builder);
    _copyOnWrite = false;
  }
  _builder[key] = LDValue.normalize(value);
  return this;
}