PostModel constructor
const
PostModel(- {String? userID,
- @JsonKey(fromJson: dateTimeFromJson, toJson: dateTimeToJson) DateTime? postDate,
- String? description,
- String? descriptionPlain,
- String? postID,
- String? event,
- @Default(false) bool approved,
- String? link,
- String? buttonText,
- @Default(false) bool isEdited}
)
Implementation
const factory PostModel({
/// The id of the user who created the post
String? userID,
/// The date and time the post was created
@JsonKey(fromJson: dateTimeFromJson, toJson: dateTimeToJson)
DateTime? postDate,
/// The body of the post in Quill format
String? description,
/// The body of the post in plain text
String? descriptionPlain,
/// The id of the post
String? postID,
/// The id of the event linked to the post, if any
String? event,
/// Whether the post is approved
@Default(false) bool approved,
/// The URL of a linked page, if any.
///
/// If this is not null, the post will show a button that links to the URL.
String? link,
/// The text of the button that links to the URL.
String? buttonText,
/// Whether the post has been edited
@Default(false) bool isEdited,
}) = _PostModel;