addReplyComment method

Future<ReplyCommentModel?> addReplyComment(
  1. dynamic postComments,
  2. dynamic user,
  3. dynamic comment
)

Implementation

Future<ReplyCommentModel?> addReplyComment(postComments, user, comment) {
  Log(
    logName: 'AddReplyComment',
    className: 'Comment',
    methodName: 'addReplyComment',
    type: 'INFO',
    text:
        '{event: Add Reply Comment, user: ${currentUser?.userPayloadId}, user is ${currentUser?.firstName} ${currentUser?.lastName}, post id: $postComments, comment: $comment',
  );
  return _httpService
      .addReplyComment(
          postComments: postComments, user: user, comment: comment)
      .then((data) async {
    if (data.statusCode >= 200 && data.statusCode < 300) {
      List<dynamic> res = json.decode(data.body);
      ReplyCommentModel replyComment = ReplyCommentModel.fromJson(res[0]);
      if (replyComment != null) return replyComment;

      return null;
    }
    return null;
  });
}