Latest json_serializable
MODIFY
lib/src/common.g.dart
lib/src/common.g.dart
@@ -9,7 +9,7 @@ part of github.common;
Map<String, dynamic> _$CreateGitBlobToJson(CreateGitBlob instance) =>
<String, dynamic>{
'content': instance.content,
- 'encoding': instance.encoding
+ 'encoding': instance.encoding,
};
GitCommit _$GitCommitFromJson(Map<String, dynamic> json) {
@@ -51,8 +51,11 @@ Map<String, dynamic> _$CreateGitCommitToJson(CreateGitCommit instance) {
}
GitCommitUser _$GitCommitUserFromJson(Map<String, dynamic> json) {
- return GitCommitUser(json['name'] as String, json['email'] as String,
- json['date'] == null ? null : DateTime.parse(json['date'] as String));
+ return GitCommitUser(
+ json['name'] as String,
+ json['email'] as String,
+ json['date'] == null ? null : DateTime.parse(json['date'] as String),
+ );
}
Map<String, dynamic> _$GitCommitUserToJson(GitCommitUser instance) {
@@ -66,8 +69,7 @@ Map<String, dynamic> _$GitCommitUserToJson(GitCommitUser instance) {
writeNotNull('name', instance.name);
writeNotNull('email', instance.email);
- writeNotNull('date',
- instance.date == null ? null : dateToGitHubIso8601(instance.date));
+ writeNotNull('date', dateToGitHubIso8601(instance.date));
return val;
}
@@ -77,10 +79,10 @@ GitTree _$GitTreeFromJson(Map<String, dynamic> json) {
json['url'] as String,
json['truncated'] as bool,
(json['tree'] as List)
- ?.map((e) => e == null
- ? null
- : GitTreeEntry.fromJson(e as Map<String, dynamic>))
- ?.toList());
+ ?.map((e) =>
+ e == null ? null : GitTreeEntry.fromJson(e as Map<String, dynamic>))
+ ?.toList(),
+ );
}
GitTreeEntry _$GitTreeEntryFromJson(Map<String, dynamic> json) {
@@ -90,7 +92,8 @@ GitTreeEntry _$GitTreeEntryFromJson(Map<String, dynamic> json) {
json['type'] as String,
json['size'] as int,
json['sha'] as String,
- json['url'] as String);
+ json['url'] as String,
+ );
}
GitReference _$GitReferenceFromJson(Map<String, dynamic> json) {
@@ -118,7 +121,10 @@ GitTag _$GitTagFromJson(Map<String, dynamic> json) {
GitObject _$GitObjectFromJson(Map<String, dynamic> json) {
return GitObject(
- json['type'] as String, json['sha'] as String, json['url'] as String);
+ json['type'] as String,
+ json['sha'] as String,
+ json['url'] as String,
+ );
}
TeamRepository _$TeamRepositoryFromJson(Map<String, dynamic> json) {
@@ -164,7 +170,10 @@ TeamRepository _$TeamRepositoryFromJson(Map<String, dynamic> json) {
TeamRepositoryPermissions _$TeamRepositoryPermissionsFromJson(
Map<String, dynamic> json) {
return TeamRepositoryPermissions(
- json['admin'] as bool, json['push'] as bool, json['pull'] as bool);
+ json['admin'] as bool,
+ json['push'] as bool,
+ json['pull'] as bool,
+ );
}
GitHubComparison _$GitHubComparisonFromJson(Map<String, dynamic> json) {
@@ -173,7 +182,8 @@ GitHubComparison _$GitHubComparisonFromJson(Map<String, dynamic> json) {
json['status'] as String,
json['ahead_by'] as int,
json['behind_by'] as int,
- json['total_commits'] as int);
+ json['total_commits'] as int,
+ );
}
Repository _$RepositoryFromJson(Map<String, dynamic> json) {
@@ -213,8 +223,12 @@ Repository _$RepositoryFromJson(Map<String, dynamic> json) {
}
CloneUrls _$CloneUrlsFromJson(Map<String, dynamic> json) {
- return CloneUrls(json['git'] as String, json['ssh'] as String,
- json['https'] as String, json['svn'] as String);
+ return CloneUrls(
+ json['git'] as String,
+ json['ssh'] as String,
+ json['https'] as String,
+ json['svn'] as String,
+ );
}
Tag _$TagFromJson(Map<String, dynamic> json) {
@@ -224,7 +238,8 @@ Tag _$TagFromJson(Map<String, dynamic> json) {
? null
: CommitInfo.fromJson(json['commit'] as Map<String, dynamic>),
json['zipball_url'] as String,
- json['tarball_url'] as String);
+ json['tarball_url'] as String,
+ );
}
CommitData _$CommitDataFromJson(Map<String, dynamic> json) {
@@ -242,14 +257,16 @@ CommitData _$CommitDataFromJson(Map<String, dynamic> json) {
json['committer'] == null
? null
: CommitDataUser.fromJson(json['committer'] as Map<String, dynamic>),
- (json['parents'] as List)
- ?.map((e) => e as Map<String, dynamic>)
- ?.toList());
+ (json['parents'] as List)?.map((e) => e as Map<String, dynamic>)?.toList(),
+ );
}
CommitDataUser _$CommitDataUserFromJson(Map<String, dynamic> json) {
return CommitDataUser(
- json['login'] as String, json['id'] as int, json['type'] as String);
+ json['login'] as String,
+ json['id'] as int,
+ json['type'] as String,
+ );
}
CommitInfo _$CommitInfoFromJson(Map<String, dynamic> json) {
@@ -257,12 +274,17 @@ CommitInfo _$CommitInfoFromJson(Map<String, dynamic> json) {
json['sha'] as String,
json['tree'] == null
? null
- : GitTree.fromJson(json['tree'] as Map<String, dynamic>));
+ : GitTree.fromJson(json['tree'] as Map<String, dynamic>),
+ );
}
UserInformation _$UserInformationFromJson(Map<String, dynamic> json) {
- return UserInformation(json['login'] as String, json['id'] as int,
- json['avatar_url'] as String, json['html_url'] as String);
+ return UserInformation(
+ json['login'] as String,
+ json['id'] as int,
+ json['avatar_url'] as String,
+ json['html_url'] as String,
+ );
}
Branch _$BranchFromJson(Map<String, dynamic> json) {
@@ -270,7 +292,8 @@ Branch _$BranchFromJson(Map<String, dynamic> json) {
json['name'] as String,
json['commit'] == null
? null
- : CommitData.fromJson(json['commit'] as Map<String, dynamic>));
+ : CommitData.fromJson(json['commit'] as Map<String, dynamic>),
+ );
}
LicenseDetails _$LicenseDetailsFromJson(Map<String, dynamic> json) {
@@ -280,9 +303,8 @@ LicenseDetails _$LicenseDetailsFromJson(Map<String, dynamic> json) {
sha: json['sha'] as String,
size: json['size'] as int,
url: json['url'] == null ? null : Uri.parse(json['url'] as String),
- htmlUrl: json['html_url'] == null
- ? null
- : Uri.parse(json['html_url'] as String),
+ htmlUrl:
+ json['html_url'] == null ? null : Uri.parse(json['html_url'] as String),
gitUrl:
json['git_url'] == null ? null : Uri.parse(json['git_url'] as String),
downloadUrl: json['download_url'] == null
@@ -296,7 +318,8 @@ LicenseDetails _$LicenseDetailsFromJson(Map<String, dynamic> json) {
: Links.fromJson(json['_links'] as Map<String, dynamic>),
license: json['license'] == null
? null
- : LicenseKind.fromJson(json['license'] as Map<String, dynamic>));
+ : LicenseKind.fromJson(json['license'] as Map<String, dynamic>),
+ );
}
Map<String, dynamic> _$LicenseDetailsToJson(LicenseDetails instance) =>
@@ -313,7 +336,7 @@ Map<String, dynamic> _$LicenseDetailsToJson(LicenseDetails instance) =>
'content': instance.content,
'encoding': instance.encoding,
'_links': instance.links,
- 'license': instance.license
+ 'license': instance.license,
};
LicenseKind _$LicenseKindFromJson(Map<String, dynamic> json) {
@@ -322,7 +345,8 @@ LicenseKind _$LicenseKindFromJson(Map<String, dynamic> json) {
name: json['name'] as String,
spdxId: json['spdx_id'] as String,
url: json['url'] == null ? null : Uri.parse(json['url'] as String),
- nodeId: json['node_id'] as String);
+ nodeId: json['node_id'] as String,
+ );
}
Map<String, dynamic> _$LicenseKindToJson(LicenseKind instance) =>
@@ -331,20 +355,21 @@ Map<String, dynamic> _$LicenseKindToJson(LicenseKind instance) =>
'name': instance.name,
'spdx_id': instance.spdxId,
'url': instance.url?.toString(),
- 'node_id': instance.nodeId
+ 'node_id': instance.nodeId,
};
Links _$LinksFromJson(Map<String, dynamic> json) {
return Links(
git: json['git'] == null ? null : Uri.parse(json['git'] as String),
self: json['self'] == null ? null : Uri.parse(json['self'] as String),
- html: json['html'] == null ? null : Uri.parse(json['html'] as String));
+ html: json['html'] == null ? null : Uri.parse(json['html'] as String),
+ );
}
Map<String, dynamic> _$LinksToJson(Links instance) => <String, dynamic>{
'self': instance.self?.toString(),
'git': instance.git?.toString(),
- 'html': instance.html?.toString()
+ 'html': instance.html?.toString(),
};
ContributorStatistics _$ContributorStatisticsFromJson(
@@ -358,22 +383,25 @@ ContributorStatistics _$ContributorStatisticsFromJson(
?.map((e) => e == null
? null
: ContributorWeekStatistics.fromJson(e as Map<String, dynamic>))
- ?.toList());
+ ?.toList(),
+ );
}
ContributorWeekStatistics _$ContributorWeekStatisticsFromJson(
Map<String, dynamic> json) {
return ContributorWeekStatistics(
- json['w'] as int, json['a'] as int, json['d'] as int, json['c'] as int);
+ json['w'] as int,
+ json['a'] as int,
+ json['d'] as int,
+ json['c'] as int,
+ );
}
CodeSearchResults _$CodeSearchResultsFromJson(Map<String, dynamic> json) {
return CodeSearchResults()
..totalCount = json['total_count'] as int
..incompleteResults = json['incomplete_results'] as bool
- ..items = json['items'] == null
- ? null
- : CodeSearchItem.fromJsonList(json['items'] as List);
+ ..items = CodeSearchItem.fromJsonList(json['items'] as List);
}
CodeSearchItem _$CodeSearchItemFromJson(Map<String, dynamic> json) {
@@ -381,12 +409,9 @@ CodeSearchItem _$CodeSearchItemFromJson(Map<String, dynamic> json) {
..name = json['name'] as String
..path = json['path'] as String
..sha = json['sha'] as String
- ..url = json['url'] == null ? null : Uri.parse(json['url'] as String)
- ..gitUrl =
- json['git_url'] == null ? null : Uri.parse(json['git_url'] as String)
- ..htmlUrl =
- json['html_url'] == null ? null : Uri.parse(json['html_url'] as String)
- ..repository = json['repository'] == null
- ? null
- : Repository.fromJSON(json['repository'] as Map<String, dynamic>);
+ ..url = Uri.parse(json['url'] as String)
+ ..gitUrl = Uri.parse(json['git_url'] as String)
+ ..htmlUrl = Uri.parse(json['html_url'] as String)
+ ..repository =
+ Repository.fromJSON(json['repository'] as Map<String, dynamic>);
}

MODIFY
lib/src/common/model/repos_releases.g.dart
lib/src/common/model/repos_releases.g.dart
@@ -48,12 +48,8 @@ Map<String, dynamic> _$ReleaseToJson(Release instance) => <String, dynamic>{
'prerelease': instance.prerelease,
'created_at': instance.createdAt?.toIso8601String(),
'published_at': instance.publishedAt?.toIso8601String(),
- 'author': instance.author == null
- ? null
- : Release._authorToJson(instance.author),
- 'assets': instance.assets == null
- ? null
- : Release._assetsToJson(instance.assets)
+ 'author': Release._authorToJson(instance.author),
+ 'assets': Release._assetsToJson(instance.assets),
};
ReleaseAsset _$ReleaseAssetFromJson(Map<String, dynamic> json) {
@@ -85,11 +81,13 @@ Map<String, dynamic> _$ReleaseAssetToJson(ReleaseAsset instance) =>
'size': instance.size,
'download_count': instance.downloadCount,
'created_at': instance.createdAt?.toIso8601String(),
- 'updated_at': instance.updatedAt?.toIso8601String()
+ 'updated_at': instance.updatedAt?.toIso8601String(),
};
CreateRelease _$CreateReleaseFromJson(Map<String, dynamic> json) {
- return CreateRelease(json['tag_name'] as String)
+ return CreateRelease(
+ json['tag_name'] as String,
+ )
..json = json['json'] as Map<String, dynamic>
..targetCommitish = json['target_commitish'] as String
..name = json['name'] as String
@@ -106,5 +104,5 @@ Map<String, dynamic> _$CreateReleaseToJson(CreateRelease instance) =>
'name': instance.name,
'body': instance.body,
'draft': instance.draft,
- 'prerelease': instance.prerelease
+ 'prerelease': instance.prerelease,
};

MODIFY
lib/src/common/model/users.g.dart
lib/src/common/model/users.g.dart
@@ -50,7 +50,7 @@ Map<String, dynamic> _$UserToJson(User instance) => <String, dynamic>{
'followers': instance.followersCount,
'following': instance.followingCount,
'created_at': instance.createdAt?.toIso8601String(),
- 'updated_at': instance.updatedAt?.toIso8601String()
+ 'updated_at': instance.updatedAt?.toIso8601String(),
};
Collaborator _$CollaboratorFromJson(Map<String, dynamic> json) {
@@ -62,7 +62,8 @@ Collaborator _$CollaboratorFromJson(Map<String, dynamic> json) {
json['site_admin'] as bool,
(json['permissions'] as Map<String, dynamic>)?.map(
(k, e) => MapEntry(k, e as bool),
- ));
+ ),
+ );
}
CurrentUser _$CurrentUserFromJson(Map<String, dynamic> json) {

MODIFY
pubspec.yaml
pubspec.yaml
@@ -17,7 +17,7 @@ dev_dependencies:
build_runner: any
build_test: any
build_web_compilers: any
- json_serializable: ^2.0.0
+ json_serializable: ^3.1.0
mockito: ^3.0.0
pedantic: ^1.0.0
test: ^1.3.0

Latest json_serializable