createContact method

Implementation

Future<DecryptedContactDto?> createContact(UserDto user, DecryptedContactDto contact, CryptoConfig<DecryptedContactDto, ContactDto> config) async {
  var newContact = await this.rawCreateContact(await config.encryptContact(
      user.dataOwnerId()!, <String>{...(user.autoDelegations["all"] ?? {}), ...(user.autoDelegations["medicalInformation"] ?? {})}, (await contact.initDelegations(user, config))));
  return newContact != null ? await config.decryptContact(user.dataOwnerId()!, newContact) : null;
}