Skip to main content

Post Model

The Post class represents a post within a community, capturing various attributes and user interactions. This model is fundamental for displaying and managing user-generated content. Below are the details of the Post model:

Properties

VariableTypeDescriptionOptional
idStringThe unique identifier of the post.
textStringThe text content of the post.
attachmentsList<Attachment>List of attachments associated with the post.
communityIdintThe unique identifier of the community where the post is made.
isPinnedboolIndicates whether the post is pinned.
userIdStringThe unique identifier of the user who created the post.
likeCountintThe count of likes received by the post.
commentCountintThe count of comments received by the post.
isSavedboolIndicates whether the post is saved by the user.
isLikedboolIndicates whether the post is liked by the user.
menuItemsList<PopupMenuItemModel>List of menu items associated with the post.
createdAtDateTimeThe date and time when the post was created.
updatedAtDateTimeThe date and time when the post was last updated.
isEditedboolIndicates whether the post has been edited.
topicsList<String>List of topics associated with the post.
repliesList<CommentList of comments as replies to the post.
isRepostboolIndicates whether the post is a repost.
isRepostedByUserboolIndicates whether the post is reposted by the user.
repostCountintThe count of reposts received by the post.
isDeletedboolIndicates whether the post is deleted.

PopupMenuItemModel

The PopupMenuItemModel class represents a menu item within the context of a post. It provides information about the title and the unique identifier of the menu item. Below are the details of the PopupMenuItemModel model:

Properties

VariableTypeDescriptionOptional
titleStringThe title of the menu item.
idintThe unique identifier of the menu item.

Attachment

The Attachment class represents an attachment associated with a post. It includes details about the attachment type and additional metadata. Below are the details of the Attachment model:

Properties

VariableTypeDescriptionOptional
attachmentTypeintThe type of the attachment.
attachmentMetaAttachmentMetaAdditional metadata associated with the attachment.

AttachmentMeta

The AttachmentMeta class encapsulates additional metadata associated with an attachment. It provides information about the URL, format, size, duration, page count, Open Graph tags, dimensions, aspect ratio, and custom metadata. Below are the details of the AttachmentMeta model:

Properties

VariableTypeDescriptionOptional
urlStringThe URL of the attachment.
formatStringThe format or file type of the attachment.
sizeintThe size of the attachment in bytes.
durationintThe duration of the attachment (applicable to videos).
pageCountintThe number of pages in the attachment (applicable to documents).
ogTagsOgTagsOpen Graph tags associated with the attachment.
aspectRatiodoubleThe aspect ratio of the attachment.
widthdoubleThe width of the attachment.
heightdoubleThe height of the attachment.
metaMap<String, dynamic>Custom metadata associated with the attachment.
entityIdStringThe unique identifier of the entity associated with the attachment.

OgTags

The OgTags class represents Open Graph (OG) tags associated with content, providing metadata that can be used when shared on social media platforms. Below are the details of the OgTags model:

Properties

VariableTypeDescriptionOptional
descriptionStringThe description associated with the OG tags.
imageStringThe URL of the image associated with the OG tags.
titleStringThe title associated with the OG tags.
urlStringThe URL associated with the OG tags.

PopupMenuItemModel

This model is used to represent the menu items for a post.

Properties

VARIABLETYPEDESCRIPTIONOPTIONAL
idintID of the menu item.
titleStringTitle of the menu item.