LikePost constructor

  1. @JsonSerializable.new(includeIfNull: false)
const LikePost({
  1. @JsonKey.new(name: 'post_id') required int postId,
  2. required int score,
  3. required String auth,
  4. String? emoji,
  5. bool? private,
})

Implementation

@JsonSerializable(includeIfNull: false)
const factory LikePost({
  /// The post to vote on.
  @JsonKey(name: 'post_id') required int postId,

  /// The vote score: 1 = upvote, -1 = downvote, 0 = remove vote.
  required int score,

  /// Auth token.
  required String auth,

  /// Optional emoji for the vote.
  String? emoji,

  /// Whether the vote is private.
  bool? private,
}) = _LikePost;