tryDecryptAttachment method

Future<Uint8List?> tryDecryptAttachment(
  1. String sdkId,
  2. Document document,
  3. Uint8List encryptedAttachment
)

Implementation

Future<Uint8List?> tryDecryptAttachment(String sdkId, Document document, Uint8List encryptedAttachment) async {
	final res = await _methodChannel.invokeMethod<String>(
		'DocumentApi.tryDecryptAttachment',
		{
			"sdkId": sdkId,
			"document": jsonEncode(Document.encode(document)),
			"encryptedAttachment": jsonEncode(base64Encode(encryptedAttachment as List<int>)),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method tryDecryptAttachment");
	final parsedResJson = jsonDecode(res);
	return parsedResJson == null ? null : base64Decode(parsedResJson as String);
}