shareWith method

Future<EncryptedPatient> shareWith(
  1. String sdkId,
  2. String delegateId,
  3. EncryptedPatient patient,
  4. PatientShareOptions? options,
)

Implementation

Future<EncryptedPatient> shareWith(String sdkId, String delegateId, EncryptedPatient patient, PatientShareOptions? options) async {
	final res = await _methodChannel.invokeMethod<String>(
		'PatientApi.encrypted.shareWith',
		{
			"sdkId": sdkId,
			"delegateId": jsonEncode(delegateId),
			"patient": jsonEncode(EncryptedPatient.encode(patient)),
			"options": jsonEncode(options == null ? null : PatientShareOptions.encode(options!)),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method shareWith");
	final parsedResJson = jsonDecode(res);
	return EncryptedPatient.fromJSON(parsedResJson);
}