setRawMainAttachment method

Future<EncryptedDocument> setRawMainAttachment(
  1. String sdkId,
  2. String documentId,
  3. String rev,
  4. List<String>? utis,
  5. Uint8List attachment,
  6. bool encrypted,
)

Implementation

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