ConfigCatUser class

An object containing attributes to properly identify a given user for variation evaluation. Its only mandatory attribute is the identifier.

Custom attributes of the user for advanced targeting rule definitions (e.g. user role, subscription type, etc.)

The set of allowed attribute values depends on the comparison type of the condition which references the User Object attribute.
String values are supported by all comparison types (in some cases they need to be provided in a specific format though).
Some of the comparison types work with other types of values, as described below.

Text-based comparisons (EQUALS, IS ONE OF, etc.)

  • accept String values,
  • all other values are automatically converted to string (a warning will be logged but evaluation will continue as normal).

SemVer-based comparisons (IS ONE OF, <, >=, etc.)

  • accept String values containing a properly formatted, valid semver value,
  • all other values are considered invalid (a warning will be logged and the currently evaluated targeting rule will be skipped).

Number-based comparisons (=, <, >=, etc.)

  • accept double values (except for double.nan) and all other numeric values which can safely be converted to double
  • accept String values containing a properly formatted, valid double value
  • all other values are considered invalid (a warning will be logged and the currently evaluated targeting rule will be skipped).

Date time-based comparisons (BEFORE / AFTER)

  • accept DateTime values, which are automatically converted to a second-based Unix timestamp
  • accept double values (except for {@code Double.NaN}) representing a second-based Unix timestamp and all other numeric values which can safely be converted to {@link Double}
  • accept String values containing a properly formatted, valid double value
  • all other values are considered invalid (a warning will be logged and the currently evaluated targeting rule will be skipped).

String array-based comparisons (ARRAY CONTAINS ANY OF / ARRAY NOT CONTAINS ANY OF)

  • accept List of String
  • accept List of dynamic values, which are automatically converted to String
  • accept Set of dynamic values, which are automatically converted to String
  • accept String values containing a valid JSON string which can be deserialized to an array of String
  • all other values are considered invalid (a warning will be logged and the currently evaluated targeting rule will be skipped).

In case a non-string attribute value needs to be converted to String during evaluation, it will always be done using the same format which is accepted by the comparisons.

Constructors

ConfigCatUser({required String identifier, String? email, String? country, Map<String, Object>? custom})

Properties

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

Methods

getAttribute(String key) Object?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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