encryptAndSetMainAttachment method
Implementation
Future<EncryptedDocument> encryptAndSetMainAttachment(String sdkId, Document document, List<String>? utis, Uint8List attachment) async {
final res = await _methodChannel.invokeMethod<String>(
'DocumentApi.encryptAndSetMainAttachment',
{
"sdkId": sdkId,
"document": jsonEncode(Document.encode(document)),
"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 encryptAndSetMainAttachment");
final parsedResJson = jsonDecode(res);
return EncryptedDocument.fromJSON(parsedResJson);
}