newAtKey method
Creates a new AtKey with the specified parameters
Implementation
AtKey newAtKey(int ttr, String key, String sharedWith, {int? ttl}) {
if (sharedWith[0] != '@') {
sharedWith = '@$sharedWith';
}
String sharedBy = (atClient!.getCurrentAtSign()![0] != '@')
? ('@${atClient!.getCurrentAtSign()!}')
: atClient!.getCurrentAtSign()!;
var atKey = AtKey()
..metadata = Metadata()
..metadata.ttr = ttr
..metadata.ccd = true
..key = key
..sharedWith = sharedWith
..sharedBy = sharedBy;
if (ttl != null) atKey.metadata.ttl = ttl;
return atKey;
}