CfClient class

Main SDK client used for SDK initialization and flags evaluation. The initialization is done with help of CfConfigurationBuilder. Example:

final conf = CfConfigurationBuilder()
    .setStreamEnabled(true)
    .setPollingInterval(60) //time in seconds (minimum value is 60)
    .build();
final target = CfTargetBuilder().setIdentifier(name).build();

final res = await CfClient.initialize(apiKey, conf, target);

Constructors

CfClient()

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

boolVariation(String id, bool defaultValue) Future<bool>
Performs boolean evaluation for given evaluation id. If no such id is present, the default value will be returned.
convertValueByKind(String kind, dynamic value) → dynamic
destroy() Future<void>
Client's method to deregister and cleanup internal resources used by SDK
initialize(String apiKey, CfConfiguration configuration, CfTarget target) Future<InitializationResult>
Initializes the SDK client with provided API key, configuration and target. Returns information if initialization succeeded or not
jsonVariation(String flag, Map defaultValue) Future<Map>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
numberVariation(String id, double defaultValue) Future<double>
Performs evaluation for given evaluation id with double value. If no such id is present, the default value will be returned.
registerEventsListener(CfEventsListener listener) Future<void>
Register a listener for different types of events. Possible types are based on EventType class
stringVariation(String id, String defaultValue) Future<String>
Performs string evaluation for given evaluation id. If no such id is present, the default value will be returned.
toString() String
A string representation of this object.
inherited
unregisterEventsListener(CfEventsListener listener) Future<void>
Removes a previously-registered listener from internal collection of listeners. From this point, provided listener will not receive any events triggered by SDK

Operators

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

Static Methods

getInstance() CfClient