addSubComment method

dynamic addSubComment({
  1. required String comment,
  2. required int mainCommentId,
  3. String? postId,
})

Implementation

addSubComment(
    {required String comment, required int mainCommentId, String? postId}) {
  var reuslt = SubCommentDTO(
      postId: '$postId',
      commentedBy: "Sub Comment User",
      userId: "XXXXX-001",
      userDispalyName: "KM",
      commentedDate: DateTime.now(),
      comment: comment,
      commentImgUrl: [],
      commentLikeCounts: getEmojiesForLike(),
      likesUsers: [],
      tagTo: '@${replyTo}');
  listOfComments[mainCommentId].replies.add(reuslt);
}