PostModel constructor

const PostModel(
  1. {String? userID,
  2. @JsonKey(fromJson: dateTimeFromJson, toJson: dateTimeToJson) DateTime? postDate,
  3. String? description,
  4. String? descriptionPlain,
  5. String? postID,
  6. String? event,
  7. @Default(false) bool approved,
  8. String? link,
  9. String? buttonText,
  10. @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;