upsert method

void upsert(
  1. UDocRecord record
)

Implementation

void upsert(UDocRecord record) {
  final UDocRecord? existing = byFingerprint(record.fingerprint);
  if (existing == null) {
    _records.add(record);
  } else {
    _records[_records.indexOf(existing)] = record;
  }
  notifyListeners();
  unawaited(save());
}