tryDecrypt method

Future<Document> tryDecrypt(
  1. String sdkId,
  2. EncryptedDocument document
)

Implementation

Future<Document> tryDecrypt(String sdkId, EncryptedDocument document) async {
	final res = await _methodChannel.invokeMethod<String>(
		'DocumentApi.tryDecrypt',
		{
			"sdkId": sdkId,
			"document": jsonEncode(EncryptedDocument.encode(document)),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method tryDecrypt");
	final parsedResJson = jsonDecode(res);
	return Document.fromJSON(parsedResJson);
}