follow method

Future<Atsign?> follow(
  1. String? atsign
)

Follows an atsign by adding it in your followers list

Implementation

Future<Atsign?> follow(String? atsign) async {
  if (atsign == _sdkService.atsign) {
    return null;
  }
  atsign = formatAtSign(atsign);
  var atKey = this._formKey(isFollowing: true);
  var atMetadata = atKey.metadata;
  if (following.list!.contains(atsign) || atsign == _sdkService.atsign) {
    return null;
  }
  following.add(atsign);
  var result = await _sdkService.put(atKey, following.toString());
  await _sdkService.sync();
  //change metadata to private to notify
  if (result) {
    atKey..sharedWith = atsign;
    atMetadata..isPublic = false;
    atKey..metadata = atMetadata;
    await _sdkService.notify(
        atKey, atsign!, OperationEnum.update, _onNotifyDone, _onNotifyError);
  }
  var atsignData =
      await _getAtsignData(atsign, isNew: true, isFollowing: true);
  await _sdkService.sync();
  return atsignData;
}