LDCommonClient class final

Constructors

LDCommonClient(LDCommonConfig commonConfig, CommonPlatform platform, LDContext context, DiagnosticSdkData sdkData, {DataSourceFactoriesFn? dataSourceFactories, EventProcessorFactory? eventProcessorFactory, List<Hook>? hooks})

Properties

credentialType CredentialType
Get the type of credential the SDK uses.
no setter
dataSourceStatus DataSourceStatus
no setter
dataSourceStatusChanges Stream<DataSourceStatus>
no setter
flagChanges Stream<FlagsChangedEvent>
no setter
hashCode int
The hash code for this object.
no setterinherited
initialized bool
Check if the initialization process is complete.
no setter
logger LDLogger
Get the logger for the client. This is primarily intended for SDK wrappers and LaunchDarkly provided modules. It is not recommended that this instance is used for general purpose logging.
no setter
offline bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addHook(Hook hook) → void
Add a hook to SDK instance.
allFlags() Map<String, LDValue>
Returns a map of all feature flags for the current context, without sending evaluation events to LaunchDarkly.
boolVariation(String flagKey, bool defaultValue) bool
Returns the value of flag flagKey for the current context as a bool.
boolVariationDetail(String flagKey, bool defaultValue) LDEvaluationDetail<bool>
Returns the value of flag flagKey for the current context as a bool, along with information about the resultant value.
close() Future<void>
Permanently shuts down the client.
doubleVariation(String flagKey, double defaultValue) double
Returns the value of flag flagKey for the current context as a double.
doubleVariationDetail(String flagKey, double defaultValue) LDEvaluationDetail<double>
Returns the value of flag flagKey for the current context as a double, along with information about the resultant value.
flush() Future<void>
Triggers immediate sending of pending events to LaunchDarkly.
identify(LDContext context, {bool waitForNetworkResults = false}) Future<IdentifyResult>
Changes the active context.
intVariation(String flagKey, int defaultValue) int
Returns the value of flag flagKey for the current context as an int.
intVariationDetail(String flagKey, int defaultValue) LDEvaluationDetail<int>
Returns the value of flag flagKey for the current context as an int, along with information about the resultant value.
jsonVariation(String flagKey, LDValue defaultValue) LDValue
Returns the value of flag flagKey for the current context as an LDValue.
jsonVariationDetail(String flagKey, LDValue defaultValue) LDEvaluationDetail<LDValue>
Returns the value of flag flagKey for the current context as an LDValue, along with information about the resultant value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setEventSendingEnabled(bool enabled, {bool flush = true}) → void
Enable or disable event sending. When disabling event sending it may be desirable to flush pending events. For instance in a mobile app on transition to the background. This flush attempt will only be made if the network is available.
setMode(ConnectionMode mode) → void
Set the connection mode the SDK should use.
setNetworkAvailability(bool available) → void
setResolvedMode(ResolvedConnectionMode mode) → void
Set a resolved FDv2 connection mode the SDK should use.
start({bool waitForNetworkResults = false}) Future<bool>
This instructs the SDK to start connecting to LaunchDarkly. Ideally this is called before any other methods. Variation calls before the SDK has been started, or after starting but before initialization is complete, will return default values.
stringVariation(String flagKey, String defaultValue) String
Returns the value of flag flagKey for the current context as a string.
stringVariationDetail(String flagKey, String defaultValue) LDEvaluationDetail<String>
Returns the value of flag flagKey for the current context as a string, along with information about the resultant value.
toString() String
A string representation of this object.
inherited
track(String eventName, {LDValue? data, num? metricValue}) → void
Track custom events associated with the current context for data export or experimentation.

Operators

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