IntelliToggleClient class
Convenience wrapper over OpenFeature client with IntelliToggle-specific methods
This client provides idiomatic Dart methods for flag evaluation with built-in context processing and IntelliToggle-specific features like multi-context support.
Example usage:
final client = IntelliToggleClient(featureClient);
final enabled = await client.getBooleanValue(
'my-flag',
false,
targetingKey: 'user-123',
evaluationContext: {'role': 'admin'},
);
New IntelliToggle client with enhanced error handling and timeout support
Constructors
- IntelliToggleClient(FeatureClient _client, {Duration timeout = const Duration(seconds: 10)})
- Creates a new IntelliToggle client wrapper with corrected endpoints
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout ↔ Duration
-
Get current timeout duration
getter/setter pair
- underlyingClient → FeatureClient
-
Get the underlying OpenFeature client for advanced usage
no setter
Methods
-
createContext(
{required String targetingKey, String kind = 'user', bool? anonymous, String? name, List< String> ? privateAttributes, Map<String, dynamic> ? customAttributes}) → EvaluationContext - Create a single context of a specific kind
-
createMultiContext(
Map< String, Map< contexts) → EvaluationContextString, dynamic> > - Create a multi-context evaluation context
-
getBooleanValue(
String flagKey, bool defaultValue, {Map< String, dynamic> ? evaluationContext, String? targetingKey, String? kind, bool? anonymous, String? name, List<String> ? privateAttributes}) → Future<bool> - Evaluate a boolean flag with enhanced context processing and timeout
-
getDoubleValue(
String flagKey, double defaultValue, {Map< String, dynamic> ? evaluationContext, String? targetingKey, String? kind, bool? anonymous, String? name, List<String> ? privateAttributes}) → Future<double> - Evaluate a double flag with enhanced context processing and timeout
-
getIntegerValue(
String flagKey, int defaultValue, {Map< String, dynamic> ? evaluationContext, String? targetingKey, String? kind, bool? anonymous, String? name, List<String> ? privateAttributes}) → Future<int> - Evaluate an integer flag with enhanced context processing and timeout
-
getObjectValue(
String flagKey, Map< String, dynamic> defaultValue, {Map<String, dynamic> ? evaluationContext, String? targetingKey, String? kind, bool? anonymous, String? name, List<String> ? privateAttributes}) → Future<Map< String, dynamic> > - Evaluate an object flag with enhanced context processing and timeout
-
getStringValue(
String flagKey, String defaultValue, {Map< String, dynamic> ? evaluationContext, String? targetingKey, String? kind, bool? anonymous, String? name, List<String> ? privateAttributes}) → Future<String> - Evaluate a string flag with enhanced context processing and timeout
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
track(
String trackingEventName, {Map< String, dynamic> ? evaluationContext, String? targetingKey, String? kind, TrackingEventDetails? trackingDetails}) → Future<void> - Record a tracking event (spec Section 6)
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited