fetchfriendlist method

Future<void> fetchfriendlist()

Implementation

Future<void> fetchfriendlist() async {
  ProfileFriendListResponse response =
      await service.profileServices.friendlist(
    userID: currentUserAccounts.value.user.value.userID!,
    page: 1,
  );

  if (!response.result.status) {
    return;
  }
  friendlist.value ??= <APIProfileFriendlist>[];
  for (APIProfileFriendlist element in response.response!) {
    friendlist.value!.add(element);
  }

  friendlist.refresh();

  log("Friend List :: ${friendlist.value!.length}");
}