withEncryptionMetadata method

Future<DecryptedPatient> withEncryptionMetadata(
  1. String sdkId,
  2. DecryptedPatient? base,
  3. User? user,
  4. Map<String, AccessLevel> delegates,
)

Implementation

Future<DecryptedPatient> withEncryptionMetadata(String sdkId, DecryptedPatient? base, User? user, Map<String, AccessLevel> delegates) async {
	final res = await _methodChannel.invokeMethod<String>(
		'PatientApi.withEncryptionMetadata',
		{
			"sdkId": sdkId,
			"base": jsonEncode(base == null ? null : DecryptedPatient.encode(base!)),
			"user": jsonEncode(user == null ? null : User.encode(user!)),
			"delegates": jsonEncode(delegates.map((k0, v0) => MapEntry(k0, AccessLevel.encode(v0)))),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method withEncryptionMetadata");
	final parsedResJson = jsonDecode(res);
	return DecryptedPatient.fromJSON(parsedResJson);
}