addUniqueRelation function

void addUniqueRelation(
  1. Map<String, List<String>> rm,
  2. String key,
  3. String value
)

Implementation

void addUniqueRelation(Map<String, List<String>> rm, String key, String value) {
  var ok = rm.containsKey(key);
  if (!ok) {
    rm[key] = [value];
  }
  if (!rm[key]!.contains(value)) {
    rm[key]!.add(value);
  }
}