refreshComments method

Future<CommentForest> refreshComments({
  1. CommentSortType sort = CommentSortType.best,
})

Repopulates the CommentForest with the most up-to-date comments.

Note: some methods of generating Submission objects do not populate the comments property, resulting in it being set to null. This method can also be used to populate comments.

Implementation

Future<CommentForest> refreshComments(
    {CommentSortType sort = CommentSortType.best}) async {
  _commentSort = sort;
  final response = await fetch();
  _comments = CommentForest(this, response[1]['listing']);
  return _comments!;
}