RudderTraits class

A class representing user traits for RudderStack identify calls.

RudderTraits is used to store and manage user-specific information that can be sent with identify events. It provides a convenient way to build and manage user profile data including personal information, company details, and address information.

The traits are internally stored as a map and can be converted to different formats for web and mobile platforms. Custom traits can be added using the put and putValue methods.

Constructors

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})
Creates a new RudderTraits instance with optional user information.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(String key, dynamic value) → RudderTraits
put generic key value pairs
putAddress(Address address) → RudderTraits
Put Address
putAge(String age) → RudderTraits
put Age
putBirthdayDate(DateTime birthdayDate) → RudderTraits
put Birthday as Date
putBirthdayString(String birthdayString) → RudderTraits
Sets the user's birthday as a string.
putCompany(Company company) → RudderTraits
put Company
putCreatedAt(String createdAt) → RudderTraits
put Created At
putDescription(String description) → RudderTraits
put description
putEmail(String email) → RudderTraits
put email
putFirstName(String firstName) → RudderTraits
put First Name
putGender(String gender) → RudderTraits
put gender
putId(String id) → RudderTraits
put id
putLastName(String lastName) → RudderTraits
put Last Name
putName(String name) → RudderTraits
put name
putPhone(String phone) → RudderTraits
put phone
putTitle(String title) → RudderTraits
put title
putUserName(String userName) → RudderTraits
put User Name
putValue(Map<String, dynamic> map) → RudderTraits
Adds multiple key-value pairs to the traits extras.
toMobileTraits() → Map<String, dynamic>
Converts traits to a format suitable for mobile platforms.
toString() → String
A string representation of this object.
override
toWebTraits() → Map<String, dynamic>
Converts traits to a format suitable for web platforms.

Operators

operator ==(Object other) → bool
The equality operator.
inherited