Skip to main content

createComment method

Future createComment (String msg)

<p>This function add comment on the post. The function uses <code>createComments</code> method provided by Comment Service.</p> <p>params:</p> <ul> <li><code>msg</code> : text of the comment to add.</li> </ul>

Implementation

Future createComment(String msg) async \{
print("comment viewModel called");
await _commentService.createComments(_postID, msg);
addCommentLocally(msg);
\}