isExistingAtsign method

Future<bool?> isExistingAtsign(
  1. String? atsign
)

Implementation

Future<bool?> isExistingAtsign(String? atsign) async {
  if (atsign == null) {
    return null;
  }
  atsign = this.formatAtSign(atsign);
  var atSignsList = await getAtsignList();
  var status = await _checkAtSignServerStatus(atsign!).timeout(
      Duration(seconds: AppConstants.responseTimeLimit),
      onTimeout: () => throw ResponseStatus.TIME_OUT);
  var isExist = atSignsList != null ? atSignsList.contains(atsign) : false;
  if (status == ServerStatus.teapot) {
    isExist = false;
  }
  return isExist;
}