encryptOrValidate method

Future<List<GroupScoped<EncryptedPatient>>> encryptOrValidate(
  1. String sdkId,
  2. List<GroupScoped<Patient>> patients
)

Implementation

Future<List<GroupScoped<EncryptedPatient>>> encryptOrValidate(String sdkId, List<GroupScoped<Patient>> patients) async {
	final res = await _methodChannel.invokeMethod<String>(
		'PatientApi.inGroup.encryptOrValidate',
		{
			"sdkId": sdkId,
			"patients": jsonEncode(patients.map((x0) => GroupScoped.encode(
				x0,
				(x1) {
					return Patient.encode(x1);
				},
			)).toList()),
		}
	).catchError(convertPlatformException);
	if (res == null) throw AssertionError("received null result from platform method encryptOrValidate");
	final parsedResJson = jsonDecode(res);
	return (parsedResJson as List<dynamic>).map((x1) => GroupScoped.fromJSON(
		x1,
		(x2) {
			return EncryptedPatient.fromJSON(x2);
		},
	) ).toList();
}