initContactsService method

Future<void> initContactsService(
  1. String rootDomainFromApp,
  2. int rootPortFromApp, {
  3. bool fetchContacts = true,
})

Implementation

Future<void> initContactsService(
    String rootDomainFromApp, int rootPortFromApp,
    {bool fetchContacts = true}) async {
  loggedInUserDetails = null;
  rootDomain = rootDomainFromApp;
  rootPort = rootPortFromApp;
  atClientManager = AtClientManager.getInstance();
  currentAtsign = atClientManager.atClient.getCurrentAtSign()!;
  atContactImpl = await AtContactsImpl.getInstance(currentAtsign);
  loggedInUserDetails = await getAtSignDetails(currentAtsign);
  if (fetchContacts) {
    cachedContactList = await atContactImpl.listContacts();
    await fetchContactList();
    await fetchBlockContactList();
  }
}