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
Variable | Type | Description | Optional |
---|---|---|---|
id | String | The unique identifier of the post. | |
text | String | The text content of the post. | |
attachments | List<Attachment > | List of attachments associated with the post. | ✔ |
communityId | int | The unique identifier of the community where the post is made. | |
isPinned | bool | Indicates whether the post is pinned. | |
userId | String | The unique identifier of the user who created the post. | |
likeCount | int | The count of likes received by the post. | |
commentCount | int | The count of comments received by the post. | |
isSaved | bool | Indicates whether the post is saved by the user. | |
isLiked | bool | Indicates whether the post is liked by the user. | |
menuItems | List<PopupMenuItemModel > | List of menu items associated with the post. | |
createdAt | DateTime | The date and time when the post was created. | |
updatedAt | DateTime | The date and time when the post was last updated. | |
isEdited | bool | Indicates whether the post has been edited. | |
topics | List<String > | List of topics associated with the post. | ✔ |
replies | List<Comment | List of comments as replies to the post. | ✔ |
isRepost | bool | Indicates whether the post is a repost. | |
isRepostedByUser | bool | Indicates whether the post is reposted by the user. | |
repostCount | int | The count of reposts received by the post. | |
isDeleted | bool | Indicates 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
Variable | Type | Description | Optional |
---|---|---|---|
title | String | The title of the menu item. | |
id | int | The 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
Variable | Type | Description | Optional |
---|---|---|---|
attachmentType | int | The type of the attachment. | |
attachmentMeta | AttachmentMeta | Additional 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
Variable | Type | Description | Optional |
---|---|---|---|
url | String | The URL of the attachment. | ✔ |
format | String | The format or file type of the attachment. | ✔ |
size | int | The size of the attachment in bytes. | ✔ |
duration | int | The duration of the attachment (applicable to videos). | ✔ |
pageCount | int | The number of pages in the attachment (applicable to documents). | ✔ |
ogTags | OgTags | Open Graph tags associated with the attachment. | ✔ |
aspectRatio | double | The aspect ratio of the attachment. | ✔ |
width | double | The width of the attachment. | ✔ |
height | double | The height of the attachment. | ✔ |
meta | Map<String, dynamic> | Custom metadata associated with the attachment. | ✔ |
entityId | String | The 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
Variable | Type | Description | Optional |
---|---|---|---|
description | String | The description associated with the OG tags. | ✔ |
image | String | The URL of the image associated with the OG tags. | ✔ |
title | String | The title associated with the OG tags. | ✔ |
url | String | The URL associated with the OG tags. | ✔ |
PopupMenuItemModel
This model is used to represent the menu items for a post.
Properties
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
id | int | ID of the menu item. | |
title | String | Title of the menu item. |