boolVariationDetails method

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

Implementation

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