mergeUserTraits function

UserTraits mergeUserTraits(
  1. UserTraits a,
  2. UserTraits b
)

Implementation

UserTraits mergeUserTraits(UserTraits a, UserTraits b) {
  return UserTraits(
      address: a.address != null && b.address != null
          ? mergeAddress(a.address as Address, b.address as Address)
          : a.address ?? b.address,
      age: a.age ?? b.age,
      avatar: a.avatar ?? b.avatar,
      birthday: a.birthday ?? b.birthday,
      company: a.company != null && b.company != null
          ? mergeCompany(a.company as Company, b.company as Company)
          : a.company ?? b.company,
      createdAt: a.createdAt ?? b.createdAt,
      description: a.description ?? b.description,
      email: a.email ?? b.email,
      firstName: a.firstName ?? b.firstName,
      gender: a.gender ?? b.gender,
      id: a.id ?? b.id,
      lastName: a.lastName ?? b.lastName,
      name: a.name ?? b.name,
      phone: a.phone ?? b.phone,
      title: a.title ?? b.title,
      username: a.username ?? b.username,
      website: a.website ?? b.website,
      custom: a.custom.isEmpty ? b.custom : a.custom);
}