added missing commas and removed codegen files

This commit is contained in:
shilangyu 2020-08-08 23:46:27 +00:00
parent b829b30593
commit f4f6ddd8fe
4 changed files with 19 additions and 200 deletions

View File

@ -53,36 +53,36 @@ class CommentView {
const CommentView({ const CommentView({
this.id, this.id,
this.creatorId this.creatorId,
this.postId, this.postId,
this.postName, this.postName,
this.parentId, this.parentId,
this.content this.content,
this.removed this.removed,
this.read, this.read,
this.published this.published,
this.updated this.updated,
this.deleted this.deleted,
this.apId, this.apId,
this.local this.local,
this.communityId this.communityId,
this.communityActorId, this.communityActorId,
this.communityLocal, this.communityLocal,
this.communityName this.communityName,
this.communityIcon this.communityIcon,
this.banned, this.banned,
this.bannedFromCommunity this.bannedFromCommunity,
this.creatorActorId, this.creatorActorId,
this.creatorLocal, this.creatorLocal,
this.creatorName this.creatorName,
this.creatorPreferredUsername, this.creatorPreferredUsername,
this.creatorPublished, this.creatorPublished,
this.creatorAvatar this.creatorAvatar,
this.score this.score,
this.upvotes this.upvotes,
this.downvotes this.downvotes,
this.hotRank this.hotRank,
this.hotRankActive this.hotRankActive,
this.userId, this.userId,
this.myVote, this.myVote,
this.subscribed, this.subscribed,

View File

@ -1,80 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'comment.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CommentView _$CommentViewFromJson(Map<String, dynamic> json) {
return CommentView(
json['id'] as int,
json['creator_id'] as int,
json['post_id'] as int,
json['post_name'] as String,
json['parent_id'] as int,
json['content'] as String,
json['removed'] as bool,
json['read'] as bool,
UtilityClass.ParseDateFromJson(json['published'] as String),
UtilityClass.ParseDateFromJson(json['updated'] as String),
json['deleted'] as bool,
json['ap_id'] as String,
json['local'] as bool,
json['community_id'] as int,
json['community_actor_id'] as String,
json['community_local'] as bool,
json['community_name'] as String,
json['banned'] as bool,
json['banned_from_community'] as bool,
json['creator_actor_id'] as String,
json['creator_local'] as bool,
json['creator_name'] as String,
UtilityClass.ParseDateFromJson(json['creator_published'] as String),
json['creator_avatar'] as String,
json['score'] as int,
json['upvotes'] as int,
json['downvotes'] as int,
json['hot_rank'] as int,
json['userId'] as int,
json['myVote'] as int,
json['subscribed'] as bool,
json['saved'] as bool,
);
}
Map<String, dynamic> _$CommentViewToJson(CommentView instance) =>
<String, dynamic>{
'id': instance.id,
'creator_id': instance.creatorId,
'post_id': instance.postId,
'post_name': instance.postName,
'parent_id': instance.parentId,
'content': instance.content,
'removed': instance.removed,
'read': instance.read,
'published': instance.published?.toIso8601String(),
'updated': instance.updated?.toIso8601String(),
'deleted': instance.deleted,
'ap_id': instance.apId,
'local': instance.local,
'community_id': instance.communityId,
'community_actor_id': instance.communityActorId,
'community_local': instance.communityLocal,
'community_name': instance.communityName,
'banned': instance.banned,
'banned_from_community': instance.bannedFromCommunity,
'creator_actor_id': instance.creatorActorId,
'creator_local': instance.creatorLocal,
'creator_name': instance.creatorName,
'creator_published': instance.creatorPublished?.toIso8601String(),
'creator_avatar': instance.creatorAvatar,
'score': instance.score,
'upvotes': instance.upvotes,
'downvotes': instance.downvotes,
'hot_rank': instance.hotRank,
'userId': instance.userId,
'myVote': instance.myVote,
'subscribed': instance.subscribed,
'saved': instance.saved,
};

View File

@ -68,7 +68,7 @@ class PostView {
/// can be null /// can be null
final bool saved; final bool saved;
PostView({ const PostView({
this.id, this.id,
this.name, this.name,
this.url, this.url,

View File

@ -1,101 +0,0 @@
// 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,
UtilityClass.ParseDateFromJson(json['published'] as String),
UtilityClass.ParseDateFromJson(json['updated'] as String),
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,
UtilityClass.ParseDateFromJson(json['creator_published'] as String),
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,
UtilityClass.ParseDateFromJson(json['newest_activity_time'] as String),
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,
};