intVariationDetails method

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

Implementation

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