stringVariationDetail method Null safety

Future<LDEvaluationDetail<String?>> stringVariationDetail(
  1. String flagKey,
  2. String? defaultValue

Returns the value of flag flagKey for the current user as a string, along with information about the resultant value.

See LDEvaluationDetail for more information on the returned value. Note that LDConfigBuilder.evaluationReasons must have been set to true to request the additional evaluation information from the backend.


static Future<LDEvaluationDetail<String?>> stringVariationDetail(String flagKey, String? defaultValue) async {
  Map<String, dynamic>? result = await _channel.invokeMapMethod('stringVariationDetail', {'flagKey': flagKey, 'defaultValue': defaultValue });
  if (result == null) {
    return LDEvaluationDetail(defaultValue, -1, LDEvaluationReason.error());
  return LDEvaluationDetail(result['value'], result['variationIndex'] ?? -1, LDEvaluationReason._fromCodecValue(result['reason']));