ensureEncryptionMetadataForSelfIsInitialized method

Future<EncryptedPatient> ensureEncryptionMetadataForSelfIsInitialized(
  1. String sdkId,
  2. Map<String, AccessLevel> sharingWith
)

Implementation

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