fillIfAbsent method
Mass assigns only values that are currently absent.
Implementation
Model<TModel> fillIfAbsent(
Map<String, Object?> attributes, {
bool strict = false,
ValueCodecRegistry? registry,
}) {
final pending = <String, Object?>{};
final existing = _asAttributes.attributes;
for (final entry in attributes.entries) {
if (!existing.containsKey(entry.key) || existing[entry.key] == null) {
pending[entry.key] = entry.value;
}
}
_asAttributes.fillAttributes(
pending,
strict: strict,
registry: _effectiveCodecRegistry(registry),
);
return _self();
}