checkAtsign method

Future<bool> checkAtsign(
  1. String? atSign
)

Function to validate atsign

Implementation

Future<bool> checkAtsign(String? atSign) async {
  if (atSign == null) {
    return false;
  } else if (!atSign.contains('@')) {
    atSign = '@$atSign';
  }
  try {
    var secondaryAddress =
        await CacheableSecondaryAddressFinder(rootDomain, rootPort)
            .findSecondary(atSign);
    return secondaryAddress.host != '';
  } catch (e) {
    return false;
  }
}