postReply method

Future<Comment?> postReply(
  1. String entityId,
  2. String parentCommentId,
  3. String content
)

Posts a reply to an existing comment.

Creates a new comment that is a reply to the specified parent comment. The reply will be associated with both the parent comment and the entity.

entityId is the identifier of the entity. parentCommentId is the ID of the comment being replied to. content is the text content of the reply.

Returns the created reply Comment if successful, or null if the operation failed.

Implementation

Future<Comment?> postReply(String entityId, String parentCommentId, String content) async {
  final comment = Comment(
    id: '',
    date: DateTime.now(),
    content: content,
    parentId: parentCommentId,
    entityId: entityId,
    userId: user.uuid,
    username: user.name,
  );
  return await service.postReply(comment);
}