Comments class

Comments are attached to any movie, show, season, episode, or list and can be a quick shout or a more detailed review. Each comment can have replies and can be liked. These likes are used to determine popular comments. Comments must follow these rules and your app should indicate these to the user. Failure to adhere to these rules could suspend the user's commenting abilities.

  • Comments must be at least 5 words.

  • Comments 200 words or longer will be automatically marked as a review.

  • Correctly indicate if the comment contains spoilers.Only write comments in English - This is important!

  • Do not include app specific text like (via App Name) or #apphashtag. This clutters up the comments and failure to clean the comment text could get your app blacklisted from commenting.

Validation Errors

If a comment doesn't pass validation, it returns a 422 HTTP error code and an array of validation errors in the response. The validation errors could include: "must be at least 5 words" or "must be written in English"

Comment Formatting

Comments support markdown formatting so you'll want to render this in your app so it matches what the website does. In addition, we support inline spoiler tags like spoilertext/spoiler which you should also handle independent of the top level spoiler attribute.

Inheritance

Constructors

Comments(TraktManager manager)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

deleteCommentOrReply(String id) Future<void>
Delete a single comment.
getComment(String id) Future<CommentResponse>
Returns a single comment and indicates how many replies it has.
getCommentLikes(String id, {RequestPagination? pagination}) Future<List<CommentLike>>
Returns all users who liked a comment.
getCommentMediaItem(String id, {bool extendedFull = false}) Future<CommentMediaItem>
Returns the media item this comment is attached to.
getRecentComments({CommentType? commentType, MediaType? mediaType, bool? includeReplies, bool extendedFull = false, RequestPagination? pagination}) Future<List<MediaComment>>
Returns the most recently written comments across all of Trakt.
getReplies(String id, {RequestPagination? pagination}) Future<List<CommentResponse>>
Returns all replies for a comment.
getTrendingComments({CommentType? commentType, MediaType? mediaType, bool? includeReplies, bool extendedFull = false, RequestPagination? pagination}) Future<List<MediaComment>>
Returns all comments with the most likes and replies over the last 7 days.
getUpdatedComments({CommentType? commentType, MediaType? mediaType, bool? includeReplies, bool extendedFull = false, RequestPagination? pagination}) Future<List<MediaComment>>
Returns the most recently written comments across all of Trakt.
likeComment(String id) Future<void>
Votes help determine popular comments. Only one like is allowed per comment per user.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postComment({required String comment, required bool spoiler, Movie? movie, Show? show, Season? season, Episode? episode, TraktList? list, CommentSharing? sharing}) Future<CommentResponse>
Add a new comment to a movie, show, season, episode, or list. Make sure to allow and encourage spoilers to be indicated in your app and follow the rules listed above.
postCommentReply(String id, {required String comment, required bool spoiler}) Future<CommentResponse>
Add a new reply to an existing comment.
removeLikeComment(String id) Future<void>
Remove a like on a comment.
toString() String
A string representation of this object.
inherited
updateCommentOrReply(String id, {required String comment, required bool spoiler}) Future<CommentResponse>
Update a single comment.

Operators

operator ==(Object other) bool
The equality operator.
inherited