jsonVariation method

  1. @Deprecated("use objectVariation(featureId, defaultValue) instead")
Future<Map<String, dynamic>> jsonVariation(
  1. String featureId, {
  2. required Map<String, dynamic> defaultValue,
})

Implementation

@Deprecated("use objectVariation(featureId, defaultValue) instead")
Future<Map<String, dynamic>> jsonVariation(
  String featureId, {
  required Map<String, dynamic> defaultValue,
}) async {
  return valueGuard<Map<String, dynamic>>(
    await _invokeMethod(
      CallMethods.jsonVariation.name,
      argument: {
        CallMethodParams.featureId: featureId,
        CallMethodParams.defaultValue: defaultValue,
      },
    ),
    customMapping: (response) {
      return response;
    },
  ).onError((error, stackTrace) {
    debugPrint("get jsonVariation fail: ${error?.toString()}");
    return defaultValue;
  });
}