getDecryptDataResponse function

dynamic getDecryptDataResponse(
  1. dynamic response, {
  2. bool isJsonDecode = false,
})

Implementation

getDecryptDataResponse(dynamic response, {bool isJsonDecode = false}) {
  if (MmUtils.instance!.isEncryptData()) {
    try {
      String realResponse = Encryption.instance.decryptData(response);
      if (isJsonDecode) {
        return jsonDecode(realResponse);
      }
      return realResponse;
    } catch (e) {
      printLogs("Error from decryptData $e");
    }
    return "";
  } else {
    return response;
  }
}