encryptAndSetSecondaryAttachment method

Future<EncryptedDocument> encryptAndSetSecondaryAttachment(
  1. String sdkId,
  2. Document document,
  3. String key,
  4. List<String>? utis,
  5. Uint8List attachment,
)

Implementation

Future<EncryptedDocument> encryptAndSetSecondaryAttachment(String sdkId, Document document, String key, List<String>? utis, Uint8List attachment) async {
	final res = await _methodChannel.invokeMethod<String>(
		'DocumentApi.encryptAndSetSecondaryAttachment',
		{
			"sdkId": sdkId,
			"document": jsonEncode(Document.encode(document)),
			"key": jsonEncode(key),
			"utis": jsonEncode(utis?.map((x0) => x0).toList()),
			"attachment": jsonEncode(base64Encode(attachment as List<int>)),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method encryptAndSetSecondaryAttachment");
	final parsedResJson = jsonDecode(res);
	return EncryptedDocument.fromJSON(parsedResJson);
}