stringVariationDetails method

Future<BKTEvaluationDetails<String>> stringVariationDetails(
  1. String featureId, {
  2. required String defaultValue,
})

Implementation

Future<BKTEvaluationDetails<String>> stringVariationDetails(
  String featureId, {
  required String defaultValue,
}) async {
  final userId = await _getCurrentUserIdOrEmpty();
  return valueGuard<BKTEvaluationDetails<String>>(
    await _invokeMethod(CallMethods.stringVariationDetails.name, argument: {
      CallMethodParams.featureId: featureId,
      CallMethodParams.defaultValue: defaultValue,
    }),
    customMapping: (response) {
      return BKTEvaluationDetails.fromJson<String>(
        response,
      );
    },
  ).onError((error, stackTrace) {
    debugPrint("get stringVariationDetails fail: ${error?.toString()}");
    return BKTEvaluationDetails.createDefaultValue(
        featureId, userId, defaultValue);
  });
}