ConfigCatClient class
ConfigCat SDK client.
Constructors
- ConfigCatClient.get({required String sdkKey, ConfigCatOptions options = ConfigCatOptions.defaultOptions})
-
Creates a new or gets an already existing ConfigCatClient for the given
sdkKey
.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hooks → Hooks
-
Gets the Hooks object for subscribing events.
no setter
- httpClient → Dio
-
Gets the underlying
Dio
HTTP client.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearDefaultUser(
) → void - Sets the default user to null.
-
close(
) → void - Closes the underlying resources.
-
forceRefresh(
) → Future< RefreshResult> - Initiates a force refresh on the cached configuration.
-
getAllKeys(
) → Future< List< String> > - Gets a collection of all setting keys.
-
getAllValueDetails(
{ConfigCatUser? user}) → Future< List< EvaluationDetails> > - Gets the detailed values of all feature flags or settings.
-
getAllValues(
{ConfigCatUser? user}) → Future< Map< String, dynamic> > - Gets the values of all feature flags or settings.
-
getKeyAndValue<
T> ({required String variationId}) → Future< MapEntry< String, T> ?> -
Gets the key of a setting and its value identified by the given
variationId
(analytics).variationId
the Variation ID.T
the type of the desired feature flag or setting. Only the following types are allowed: String, bool, int, double, Object (both nullable and non-nullable) anddynamic
. -
getValue<
T> ({required String key, required T defaultValue, ConfigCatUser? user}) → Future< T> -
Gets the value of a feature flag or setting as
T
identified by the givenkey
. -
getValueDetails<
T> ({required String key, required T defaultValue, ConfigCatUser? user}) → Future< EvaluationDetails< T> > -
Gets the value and evaluation details of a feature flag or setting identified by the given
key
. -
isOffline(
) → bool - Get the client offline mode status.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setDefaultUser(
ConfigCatUser? user) → void - Sets defaultUser value. If no user specified in the following calls {getValue}, {getAllValues}, {getValueDetails}, {getAllValueDetails} the default user value will be used.
-
setOffline(
) → void - Set the client to offline mode. HTTP calls are not allowed.
-
setOnline(
) → void - Set the client to online mode. HTTP calls are allowed.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
closeAll(
) → dynamic - Closes all ConfigCatClient instances.