followUser method

void followUser(
  1. String userId
)

Implementation

void followUser(String userId) async {
  final TUIUserInfo userInfo = TUIUserInfo(
      userId: userId,
      userName: '',
      avatarUrl: '',
      userRole: TUIRole.generalUser);
  final result = await friendshipManager.followUser(userIDList: [userId]);
  const success = 0;
  if (result.code == success) {
    final Set<TUIUserInfo> followingList =
        Set.from(state.followingList.value);
    followingList.add(userInfo);
    state.followingList.value = followingList;
    getFansNumber();
  }
}