getAtSignDetails function

Future<AtContact> getAtSignDetails(
  1. String atSign
)

Function to fetch the contact details of an atsign

Implementation

Future<AtContact> getAtSignDetails(String atSign) async {
  // ignore: omit_local_variable_types
  AtContact? atContact = getCachedContactDetail(atSign);
  if (atContact == null) {
    var contactDetails = await ContactService().getContactDetails(atSign, null);
    atContact = AtContact(
      atSign: atSign,
      tags: contactDetails,
    );
    // ignore: unnecessary_null_comparison
    if (contactDetails != null) {
      ContactService().cachedContactList.add(atContact);
    }
  }
  return atContact;
}