LDCommonClient class
final
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.
launchdarkly_common_client 1.14.2