boolVariationDetail method
Returns the value of flag flagKey for the current context as a bool, along with information about the resultant value.
See LDEvaluationDetail for more information on the returned value. Note that DataSourceConfig.evaluationReasons
must have been set to true to request the additional evaluation information from the backend.
Implementation
LDEvaluationDetail<bool> boolVariationDetail(
String flagKey, bool defaultValue) {
final ldValueVariation = _hookRunner.withEvaluation(
flagKey,
_context,
LDValue.ofBool(defaultValue),
VariationMethodNames.boolVariationDetail,
() => _variationInternal(flagKey, LDValue.ofBool(defaultValue),
isDetailed: true, type: LDValueType.boolean),
environmentId: _flagManager.environmentId,
);
return LDEvaluationDetail(ldValueVariation.value.booleanValue(),
ldValueVariation.variationIndex, ldValueVariation.reason);
}