operator + method

dynamic operator +(
  1. Contact other
)

The + operator fills in this contact's empty fields with the fields from other

Implementation

operator +(Contact other) => Contact(
      givenName: givenName ?? other.givenName,
      middleName: middleName ?? other.middleName,
      prefix: prefix ?? other.prefix,
      suffix: suffix ?? other.suffix,
      familyName: familyName ?? other.familyName,
      company: company ?? other.company,
      jobTitle: jobTitle ?? other.jobTitle,
      androidAccountType: androidAccountType ?? other.androidAccountType,
      androidAccountName: androidAccountName ?? other.androidAccountName,
      emails: emails == null
          ? other.emails
          : emails!.toSet().union(other.emails?.toSet() ?? Set()).toList(),
      phones: phones == null
          ? other.phones
          : phones!.toSet().union(other.phones?.toSet() ?? Set()).toList(),
      postalAddresses: postalAddresses == null
          ? other.postalAddresses
          : postalAddresses!
              .toSet()
              .union(other.postalAddresses?.toSet() ?? Set())
              .toList(),
      avatar: avatar ?? other.avatar,
      birthday: birthday ?? other.birthday,
      note: note ?? other.note,
      socialProfiles: socialProfiles == null
          ? other.socialProfiles
          : socialProfiles!
              .toSet()
              .union(other.socialProfiles?.toSet() ?? Set())
              .toList(),
      urlAddresses: urlAddresses == null
          ? other.urlAddresses
          : urlAddresses!
              .toSet()
              .union(other.urlAddresses?.toSet() ?? Set())
              .toList(),
    );