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: this.givenName ?? other.givenName,
      middleName: this.middleName ?? other.middleName,
      prefix: this.prefix ?? other.prefix,
      suffix: this.suffix ?? other.suffix,
      familyName: this.familyName ?? other.familyName,
      company: this.company ?? other.company,
      jobTitle: this.jobTitle ?? other.jobTitle,
      androidAccountType: this.androidAccountType ?? other.androidAccountType,
      androidAccountName: this.androidAccountName ?? other.androidAccountName,
      emails: this.emails == null
          ? other.emails
          : this
              .emails!
              .toSet()
              .union(other.emails?.toSet() ?? Set())
              .toList(),
      phones: this.phones == null
          ? other.phones
          : this
              .phones!
              .toSet()
              .union(other.phones?.toSet() ?? Set())
              .toList(),
      postalAddresses: this.postalAddresses == null
          ? other.postalAddresses
          : this
              .postalAddresses!
              .toSet()
              .union(other.postalAddresses?.toSet() ?? Set())
              .toList(),
      avatar: this.avatar ?? other.avatar,
      birthday: this.birthday ?? other.birthday,
    );