Post constructor
const
Post({
- required int id,
- required String title,
- @JsonKey.new(name: 'ap_id') required String apId,
- required bool local,
- required bool nsfw,
- required bool deleted,
- required bool removed,
- @JsonKey.new(name: 'user_id') required int userId,
- @JsonKey.new(name: 'community_id') required int communityId,
- @JsonKey.new(name: 'language_id') int? languageId,
- String? body,
- String? url,
- @JsonKey.new(name: 'small_thumbnail_url') String? smallThumbnailUrl,
- @JsonKey.new(name: 'thumbnail_url') String? thumbnailUrl,
- @JsonKey.new(name: 'alt_text') String? altText,
- @JsonKey.new(name: 'image_details') WidthHeight? imageDetails,
- @JsonKey.new(name: 'published') required DateTime published,
- DateTime? updated,
- @JsonKey.new(name: 'ai_generated', defaultValue: false) required bool aiGenerated,
- bool? sticky,
- @JsonKey.new(name: 'instance_sticky') bool? instanceSticky,
- bool? locked,
- @JsonKey.new(name: 'post_type') PostType? postType,
- PostPoll? poll,
- PostEvent? event,
- @JsonKey.new(name: 'emoji_reactions') List<
Reactions> ? emojiReactions, - @JsonKey.new(name: 'cross_posts') List<
MiniCrossPosts> ? crossPosts, - String? tags,
- String? flair,
Implementation
const factory Post({
required int id,
required String title,
@JsonKey(name: 'ap_id') required String apId,
required bool local,
required bool nsfw,
required bool deleted,
required bool removed,
@JsonKey(name: 'user_id') required int userId,
@JsonKey(name: 'community_id') required int communityId,
@JsonKey(name: 'language_id') int? languageId,
String? body,
String? url,
@JsonKey(name: 'small_thumbnail_url') String? smallThumbnailUrl,
@JsonKey(name: 'thumbnail_url') String? thumbnailUrl,
@JsonKey(name: 'alt_text') String? altText,
@JsonKey(name: 'image_details') WidthHeight? imageDetails,
@JsonKey(name: 'published') required DateTime published,
DateTime? updated,
@JsonKey(name: 'ai_generated', defaultValue: false) required bool aiGenerated,
bool? sticky,
@JsonKey(name: 'instance_sticky') bool? instanceSticky,
bool? locked,
@JsonKey(name: 'post_type') PostType? postType,
PostPoll? poll,
PostEvent? event,
@JsonKey(name: 'emoji_reactions') List<Reactions>? emojiReactions,
@JsonKey(name: 'cross_posts') List<MiniCrossPosts>? crossPosts,
String? tags,
String? flair,
}) = _Post;