sharedWith property

String? sharedWith

The 'recipient' part of an atProtocol key name. For example if the key is @bob:city.address.my_app@alice then sharedWith is @bob

Implementation

String? get sharedWith => _sharedWith;
void sharedWith=(String? sharedWithAtSign)

The 'recipient' part of an atProtocol key name. For example if the key is @bob:city.address.my_app@alice then sharedWith is @bob

Implementation

set sharedWith(String? sharedWithAtSign) {
  if (sharedWithAtSign != null &&
      sharedWithAtSign.isNotEmpty &&
      (!sharedWithAtSign.startsWith('@'))) {
    sharedWithAtSign = '@$sharedWithAtSign';
  }
  if (sharedWithAtSign.isNotNullOrEmpty &&
      (isLocal == true || metadata.isPublic == true)) {
    throw InvalidAtKeyException(
        'isLocal or isPublic cannot be true when sharedWith is set');
  }
  _sharedWith = sharedWithAtSign?.toLowerCase();
}