createLists method

Future<void> createLists({
  1. required bool isFollowing,
})

creates following and followers list.

Implementation

Future<void> createLists({required bool isFollowing}) async {
  // for following list followers list is not required.
  if (!isFollowing) {
    var followersValue =
        await _sdkService.scanAndGet(AppConstants.followersKey);
    this.followers.create(followersValue);
    if (followersValue.metadata != null) {
      connectionProvider.connectionslistStatus.isFollowersPrivate =
          !followersValue.metadata!.isPublic;
      await _sdkService.sync();
    }
  } else {
    // for followers list following list is required to show the status of follow button.

    var followingValue =
        await _sdkService.scanAndGet(AppConstants.followingKey);
    this.following.create(followingValue);

    if (followingValue.metadata != null) {
      connectionProvider.connectionslistStatus.isFollowingPrivate =
          !followingValue.metadata!.isPublic;
      await _sdkService.sync();
    }
  }
}