mirror of
https://github.com/krawieck/lemmur/
synced 2024-12-16 18:39:21 +01:00
b5e8620931
Added auto generated JSON (de)serialization of PostView class by json_serializable package. Added required packages and dependencies in pubsec.yalm: - json_annotation: ^3.0.1, - json_serializable: ^3.3.0, - build_runner: ^1.10.0. TODO: Implement ParseDateFromJson static method in PostView class.
102 lines
3.6 KiB
Dart
102 lines
3.6 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'post.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
PostView _$PostViewFromJson(Map<String, dynamic> json) {
|
|
return PostView(
|
|
json['id'] as int,
|
|
json['name'] as String,
|
|
json['url'] as String,
|
|
json['body'] as String,
|
|
json['creator_id'] as int,
|
|
json['community_id'] as int,
|
|
json['removed'] as bool,
|
|
json['locked'] as bool,
|
|
PostView.ParseDateFromJson(json['published']),
|
|
PostView.ParseDateFromJson(json['updated']),
|
|
json['deleted'] as bool,
|
|
json['nsfw'] as bool,
|
|
json['stickied'] as bool,
|
|
json['embed_title'] as String,
|
|
json['embed_description'] as String,
|
|
json['embed_html'] as String,
|
|
json['thumbnail_url'] as String,
|
|
json['ap_id'] as String,
|
|
json['local'] as bool,
|
|
json['creator_actor_id'] as String,
|
|
json['creator_local'] as bool,
|
|
json['creator_name'] as String,
|
|
PostView.ParseDateFromJson(json['creator_published']),
|
|
json['creator_avatar'] as String,
|
|
json['banned'] as bool,
|
|
json['banned_from_community'] as bool,
|
|
json['community_actor_id'] as String,
|
|
json['community_local'] as bool,
|
|
json['community_name'] as String,
|
|
json['community_removed'] as bool,
|
|
json['community_deleted'] as bool,
|
|
json['community_nsfw'] as bool,
|
|
json['number_of_comments'] as int,
|
|
json['score'] as int,
|
|
json['upvotes'] as int,
|
|
json['downvotes'] as int,
|
|
json['hot_rank'] as int,
|
|
PostView.ParseDateFromJson(json['newest_activity_time']),
|
|
json['userId'] as int,
|
|
json['myVote'] as int,
|
|
json['subscribed'] as bool,
|
|
json['read'] as bool,
|
|
json['saved'] as bool,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> _$PostViewToJson(PostView instance) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'name': instance.postName,
|
|
'url': instance.url,
|
|
'body': instance.body,
|
|
'creator_id': instance.creatorId,
|
|
'community_id': instance.communityId,
|
|
'removed': instance.removed,
|
|
'locked': instance.locked,
|
|
'published': instance.published?.toIso8601String(),
|
|
'updated': instance.updated?.toIso8601String(),
|
|
'deleted': instance.deleted,
|
|
'nsfw': instance.nsfw,
|
|
'stickied': instance.stickied,
|
|
'embed_title': instance.embedTitle,
|
|
'embed_description': instance.embedDescription,
|
|
'embed_html': instance.embedHtml,
|
|
'thumbnail_url': instance.thumbnailUrl,
|
|
'ap_id': instance.apId,
|
|
'local': instance.local,
|
|
'creator_actor_id': instance.creatorActorId,
|
|
'creator_local': instance.creatorLocal,
|
|
'creator_name': instance.creatorName,
|
|
'creator_published': instance.creatorPublished?.toIso8601String(),
|
|
'creator_avatar': instance.creatorAvatar,
|
|
'banned': instance.banned,
|
|
'banned_from_community': instance.bannedFromCommunity,
|
|
'community_actor_id': instance.communityActorId,
|
|
'community_local': instance.communityLocal,
|
|
'community_name': instance.communityName,
|
|
'community_removed': instance.communityRemoved,
|
|
'community_deleted': instance.communityDeleted,
|
|
'community_nsfw': instance.communityNsfw,
|
|
'number_of_comments': instance.numberOfComments,
|
|
'score': instance.score,
|
|
'upvotes': instance.upvotes,
|
|
'downvotes': instance.downvotes,
|
|
'hot_rank': instance.hotRank,
|
|
'newest_activity_time': instance.newestActivityTime?.toIso8601String(),
|
|
'userId': instance.userId,
|
|
'myVote': instance.myVote,
|
|
'subscribed': instance.subscribed,
|
|
'read': instance.read,
|
|
'saved': instance.saved,
|
|
};
|