This commit is contained in:
toly
2020-09-03 14:38:47 +08:00
parent 3643ede3de
commit 2401387703
57 changed files with 1779 additions and 1001 deletions

View File

@@ -0,0 +1,36 @@
import 'package:flutter_unit/model/github/github_user.dart';
part 'g/IssueComment.g.dart';
class IssueComment{
int id;
GithubUser user;
DateTime createdAt;
DateTime updatedAt;
String authorAssociation;
String body;
String bodyHtml;
String type;
String htmlUrl;
IssueComment(
this.id,
this.user,
this.createdAt,
this.updatedAt,
this.authorAssociation,
this.body,
this.bodyHtml,
this.type,
this.htmlUrl,
);
factory IssueComment.fromJson(Map<String, dynamic> json) => _$IssueEventFromJson(json);
Map<String, dynamic> toJson() => _$IssueEventToJson(this);
}

View File

@@ -0,0 +1,40 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of '../IssueComment.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
IssueComment _$IssueEventFromJson(Map<String, dynamic> json) {
return IssueComment(
json['id'] as int,
json['user'] == null
? null
: GithubUser.fromJson(json['user'] as Map<String, dynamic>),
json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
json['updated_at'] == null
? null
: DateTime.parse(json['updated_at'] as String),
json['author_association'] as String,
json['body'] as String,
json['body_html'] as String,
json['event'] as String,
json['html_url'] as String,
);
}
Map<String, dynamic> _$IssueEventToJson(IssueComment instance) =>
<String, dynamic>{
'id': instance.id,
'user': instance.user,
'created_at': instance.createdAt?.toIso8601String(),
'updated_at': instance.updatedAt?.toIso8601String(),
'author_association': instance.authorAssociation,
'body': instance.body,
'body_html': instance.bodyHtml,
'event': instance.type,
'html_url': instance.htmlUrl,
};