LDUser class Null safety

An LDUser contains the attributes of a user context.

The user attributes determine the flag values in combination with the configured flag rules, and can also be used for metrics, experimentation, and data export. The only mandatory property is the LDUser.key, which must uniquely identify each user.

Besides the key, LDUser supports two types of optional attributes: built-in attributes (e.g. LDUser.name) and custom attributes. See LDUserBuilder for how to set the attribute values.

For a more complete description of user attributes and how they can be referenced in feature flag rules, see the reference guide on setting user attributes and targeting users.

Properties

anonymous bool
Whether this user is anonymous.
final
avatar String?
The user's avatar attribute.
final
country String?
The user's country attribute.
final
custom Map<String, LDValue>?
The user's custom attributes. [...]
final
email String?
The user's email attribute.
final
firstName String?
The user's firstName attribute.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
ip String?
The user's ip attribute.
final
key String
The user's key.
final
lastName String?
The user's lastName attribute.
final
name String?
The user's name attribute.
final
privateAttributeNames List<String>?
Which of the user's attributes are specified to be private. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
secondary String?
The user's secondary attribute.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited