likepost method

void likepost(
  1. Post post
)

/ This function is used to add new post to the list

Implementation

void likepost(Post post) async {
  if (likeunlikeProcces.value) {
    return;
  }

  likeunlikeProcces.value = true;

  PostLikeResponse response =
      await service.postsServices.like(postID: post.postID);
  if (!response.result.status) {
    log(response.result.description.toString());
    return;
  }

  post.isLikeme = true;
  post.likesCount++;
  likeunlikeProcces.value = false;
}