createPatients method

Implementation

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