LDContext class final

A collection of attributes that can be referenced in flag evaluations and analytics events. A LDContext may contain information about a single context or multiple contexts differentiated by the "kind" attribute.

Besides the kind and key (required), LDContext supports built in attributes (optional to use) and also custom attributes.

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

Properties

attributesByKind Map<String, LDContextAttributes>
final
canonicalKey String
Get the canonical key for the context.
no setter
hashCode int
The hash code for this object.
no setteroverride
keys Map<String, String>
Get a map of all the context kinds and their keys.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
valid bool
final

Methods

get(String kind, AttributeReference reference) LDValue
For the given context kind get an attribute using a reference. If the attribute does not exist, then a null LDValue type will be returned.
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
Determine if two contexts are equal.
override