Post class

Annotations
  • @freezed

Constructors

Post({required String id, required String slug, required String title, required String content, required UserSimple user, required PostStatus status, @Default.new(0) int upvotes, @Default.new(0) int commentCount, @Default.new(false) bool upvoted, @Default.new(false) bool downvoted, @Default.new(false) bool pinned, @Default.new(false) bool isSubscribed, required DateTime date, required DateTime lastModified, required PostCategory postCategory})
const
factory
Post.fromJson(Map<String, Object?> json)
factory

Properties

commentCount → int
Post comment count
no setterinherited
content → String
The content of the post
no setterinherited
copyWith → $PostCopyWith<Post>
Create a copy of Post with the given fields replaced by the non-null parameter values.
no setterinherited
date → DateTime
Date the post was created
no setterinherited
downvoted → bool
Whether the user has downvoted the post (false by default)
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
id → String
The id of the post
no setterinherited
isSubscribed → bool
Whether the user is subscribed to the post (false by default)
no setterinherited
lastModified → DateTime
Date the post was last updated
no setterinherited
pinned → bool
Whether the post is pinned (false by default)
no setterinherited
postCategory → PostCategory
The category of the post
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slug → String
The slug of the post
no setterinherited
status → PostStatus
The status of the post
no setterinherited
title → String
The title of the post
no setterinherited
upvoted → bool
Whether the user has upvoted the post (false by default)
no setterinherited
upvotes → int
Post upvotes
no setterinherited
user → UserSimple
The user who created the post
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this Post to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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