setRawSecondaryAttachment method

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

Implementation

Future<EncryptedDocument> setRawSecondaryAttachment(String sdkId, String documentId, String key, String rev, List<String>? utis, Uint8List attachment, bool encrypted) async {
	final res = await _methodChannel.invokeMethod<String>(
		'DocumentBasicApi.setRawSecondaryAttachment',
		{
			"sdkId": sdkId,
			"documentId": jsonEncode(documentId),
			"key": jsonEncode(key),
			"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 setRawSecondaryAttachment");
	final parsedResJson = jsonDecode(res);
	return EncryptedDocument.fromJSON(parsedResJson);
}