followUser method

Future<void> followUser(
  1. String userId
)

Implementation

Future<void> followUser(String userId) async {
  final userIDList = <String>[userId];

  try {
    await liveService.followUser(userIDList: userIDList);

    userState.myFollowingUserList.value.add(UserInfo.formUserId(userId));
    LinkedHashSet<UserInfo> tempList = LinkedHashSet<UserInfo>();
    tempList.addAll(userState.myFollowingUserList.value);
    userState.myFollowingUserList.value = tempList;
    getFansCount();
    ErrorHandler.onError(TUIError.success);
  } catch (error, stackTrace) {
    ErrorHandler.onError(TUIError.errFailed);
    LiveKitLogger.error('followUser Error: $error\n$stackTrace');
  }
}