RudderTraits constructor

RudderTraits({
  1. Address? address,
  2. String? age,
  3. String? birthday,
  4. Company? company,
  5. String? createdAt,
  6. String? description,
  7. String? email,
  8. String? firstName,
  9. String? gender,
  10. String? id,
  11. String? lastName,
  12. String? name,
  13. String? phone,
  14. String? title,
  15. String? userName,
})

Creates a new RudderTraits instance with optional user information.

All parameters are optional and can be set individually or through the various put methods after construction.

Parameters:

  • address - User's address information
  • age - User's age as a string
  • birthday - User's birthday
  • company - User's company information
  • createdAt - Account creation timestamp
  • description - User description
  • email - User's email address
  • firstName - User's first name
  • gender - User's gender
  • id - User's unique identifier
  • lastName - User's last name
  • name - User's full name
  • phone - User's phone number
  • title - User's title or position
  • userName - User's username

Implementation

RudderTraits(
    {Address? address,
    String? age,
    String? birthday,
    Company? company,
    String? createdAt,
    String? description,
    String? email,
    String? firstName,
    String? gender,
    String? id,
    String? lastName,
    String? name,
    String? phone,
    String? title,
    String? userName}) {
  if (address != null) {
    __traitsMap["address"] = address.addressMap;
  }
  if (age != null) {
    __traitsMap["age"] = age;
  }
  if (birthday != null) {
    __traitsMap["birthday"] = birthday;
  }
  if (company != null) {
    __traitsMap["company"] = company.companyMap;
  }
  if (createdAt != null) {
    __traitsMap["createdAt"] = createdAt;
  }
  if (description != null) {
    __traitsMap["description"] = description;
  }
  if (email != null) {
    __traitsMap["email"] = email;
  }
  if (firstName != null) {
    __traitsMap["firstName"] = firstName;
  }
  if (gender != null) {
    __traitsMap["gender"] = gender;
  }
  if (id != null) {
    __traitsMap["id"] = id;
    __traitsMap["oldId"] = id;
  }
  if (lastName != null) {
    __traitsMap["lastName"] = lastName;
  }
  if (name != null) {
    __traitsMap["name"] = name;
  }
  if (phone != null) {
    __traitsMap["phone"] = phone;
  }
  if (title != null) {
    __traitsMap["title"] = title;
  }
  if (userName != null) {
    __traitsMap["userName"] = userName;
  }
}