shareWith method

Future<GroupScoped<Patient>> shareWith(
  1. String sdkId,
  2. EntityReferenceInGroup delegate,
  3. GroupScoped<Patient> patient,
  4. PatientShareOptions? options,
)

Implementation

Future<GroupScoped<Patient>> shareWith(String sdkId, EntityReferenceInGroup delegate, GroupScoped<Patient> patient, PatientShareOptions? options) async {
	final res = await _methodChannel.invokeMethod<String>(
		'PatientApi.inGroup.tryAndRecover.shareWith',
		{
			"sdkId": sdkId,
			"delegate": jsonEncode(EntityReferenceInGroup.encode(delegate)),
			"patient": jsonEncode(GroupScoped.encode(
				patient,
				(x0) {
					return Patient.encode(x0);
				},
			)),
			"options": jsonEncode(options == null ? null : PatientShareOptions.encode(options!)),
		}
	).catchError(convertPlatformException);
	if (res == null) throw AssertionError("received null result from platform method shareWith");
	final parsedResJson = jsonDecode(res);
	return GroupScoped.fromJSON(
		parsedResJson,
		(x1) {
			return Patient.fromJSON(x1);
		},
	);
}