encryptAndSetSecondaryAttachment method
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);
}