RepoList: Parse more information

This way in the future we can make the repo list a bit prettier. It
currently looks quite ugly.
This commit is contained in:
Vishesh Handa
2020-09-03 20:54:46 +02:00
parent b96513b25f
commit e4fd84d4a4
3 changed files with 62 additions and 6 deletions

View File

@ -16,9 +16,9 @@ abstract class GitHost {
}
class UserInfo {
String name;
String email;
String username;
final String name;
final String email;
final String username;
UserInfo({
@required this.name,
@ -29,19 +29,50 @@ class UserInfo {
class GitHostRepo {
final String fullName;
final String description;
final String cloneUrl;
final DateTime updatedAt;
final bool private;
final int stars;
final int forks;
final String language;
final int issues;
final String license;
final List<String> tags;
GitHostRepo({
@required this.fullName,
@required this.description,
@required this.cloneUrl,
@required this.updatedAt,
@required this.private,
@required this.stars,
@required this.forks,
@required this.language,
@required this.issues,
@required this.tags,
@required this.license,
});
Map<String, dynamic> toJson() => {
'fullName': fullName,
'description': description,
'cloneUrl': cloneUrl,
'updatedAt': updatedAt,
'private': private,
'stars': stars,
'forks': forks,
'language': language,
'issues': issues,
'tags': tags,
'license': license,
};
@override
String toString() {
return 'GitRepo{fulleName: $fullName, cloneUrl: $cloneUrl, updatedAt: $updatedAt}';
}
String toString() => toJson().toString();
}
class GitHostException implements Exception {