mirror of
https://github.com/pd4d10/git-touch.git
synced 2026-03-25 04:24:42 -05:00
refactor(github): use rest api for download_url
This commit is contained in:
@@ -235,3 +235,16 @@ class GithubTrendingUserRepo {
|
||||
factory GithubTrendingUserRepo.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubTrendingUserRepoFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubTreeItem {
|
||||
String name;
|
||||
String path;
|
||||
int size;
|
||||
String type;
|
||||
String downloadUrl;
|
||||
String content;
|
||||
GithubTreeItem();
|
||||
factory GithubTreeItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubTreeItemFromJson(json);
|
||||
}
|
||||
|
||||
@@ -278,3 +278,23 @@ Map<String, dynamic> _$GithubTrendingUserRepoToJson(
|
||||
'name': instance.name,
|
||||
'description': instance.description,
|
||||
};
|
||||
|
||||
GithubTreeItem _$GithubTreeItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubTreeItem()
|
||||
..name = json['name'] as String
|
||||
..path = json['path'] as String
|
||||
..size = json['size'] as int
|
||||
..type = json['type'] as String
|
||||
..downloadUrl = json['download_url'] as String
|
||||
..content = json['content'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GithubTreeItemToJson(GithubTreeItem instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'path': instance.path,
|
||||
'size': instance.size,
|
||||
'type': instance.type,
|
||||
'download_url': instance.downloadUrl,
|
||||
'content': instance.content,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user