deduplicateProperties method

void deduplicateProperties()

Deduplicates properties.

Some properties sometimes appear duplicated because of third-party apps. For phones we compare them using the normalized number phone number if availalbe, falling back to the raw phone number. For emails we use the email address. By default we use the property hash code.

Implementation

void deduplicateProperties() {
  phones = _depuplicateProperty(
      phones,
      (x) => (x.normalizedNumber.isNotEmpty ? x.normalizedNumber : x.number)
          .hashCode);
  emails = _depuplicateProperty(emails, (x) => x.address.hashCode);
  addresses = _depuplicateProperty(addresses);
  organizations = _depuplicateProperty(organizations);
  websites = _depuplicateProperty(websites);
  socialMedias = _depuplicateProperty(socialMedias);
  events = _depuplicateProperty(events);
  notes = _depuplicateProperty(notes);
}