OptimizelyUserContext class

An object for user contexts that the SDK will use to make decisions for.

Constructors

OptimizelyUserContext(String _sdkKey, String _userContextId, MethodChannel _channel)

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

decide(String key, [Set<OptimizelyDecideOption> options = const {}]) → Future<DecideResponse>
Returns a decision result for a given flag key and a user context, which contains all data required to deliver the flag or experiment.
decideAll([Set<OptimizelyDecideOption> options = const {}]) → Future<DecideForKeysResponse>
Returns a key-map of decision results for all active flag keys.
decideAllAsync([Set<OptimizelyDecideOption> options = const {}]) → Future<DecideForKeysResponse>
Asynchronously returns a key-map of decision results for all active flag keys. This method supports CMAB (Contextual Multi-Armed Bandit) experiments.
decideAsync(String key, [Set<OptimizelyDecideOption> options = const {}]) → Future<DecideResponse>
Asynchronously returns a decision result for a given flag key and a user context. This method supports CMAB (Contextual Multi-Armed Bandit) experiments.
decideForKeys(List<String> keys, [Set<OptimizelyDecideOption> options = const {}]) → Future<DecideForKeysResponse>
Returns a key-map of decision results for multiple flag keys and a user context.
decideForKeysAsync(List<String> keys, [Set<OptimizelyDecideOption> options = const {}]) → Future<DecideForKeysResponse>
Asynchronously returns a key-map of decision results for multiple flag keys. This method supports CMAB (Contextual Multi-Armed Bandit) experiments.
fetchQualifiedSegments([Set<OptimizelySegmentOption> options = const {}]) → Future<BaseResponse>
Fetch all qualified segments for the user context.
getAttributes() → Future<GetAttributesResponse>
Returns GetAttributesResponse object containing attributes for the user context.
getForcedDecision(OptimizelyDecisionContext context) → Future<GetForcedDecisionResponse>
Returns the forced decision for a given decision context.
getQualifiedSegments() → Future<GetQualifiedSegmentsResponse>
Returns GetQualifiedSegmentsResponse object containing an array of segment names that the user is qualified for.
getUserId() → Future<GetUserIdResponse>
Returns GetUserIdResponse object containing userId for the user context.
isQualifiedFor(String segment) → Future<BaseResponse>
Checks if the user is qualified for the given segment.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAllForcedDecisions() → Future<BaseResponse>
Removes all forced decisions bound to this user context.
removeForcedDecision(OptimizelyDecisionContext context) → Future<BaseResponse>
Removes the forced decision for a given decision context.
setAttributes(Map<String, dynamic> attributes) → Future<BaseResponse>
Sets attributes for the user context.
setForcedDecision(OptimizelyDecisionContext context, OptimizelyForcedDecision decision) → Future<BaseResponse>
Sets the forced decision for a given decision context.
setQualifiedSegments(List<String> qualifiedSegments) → Future<BaseResponse>
Sets qualified segments for the user context.
toString() → String
A string representation of this object.
inherited
trackEvent(String eventKey, [Map<String, dynamic> eventTags = const {}]) → Future<BaseResponse>
Tracks an event.

Operators

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