refactor: repository item

This commit is contained in:
Rongjian Zhang
2020-01-29 13:06:55 +08:00
parent df09ee4c17
commit 6ffef6eaf6
7 changed files with 81 additions and 80 deletions

View File

@@ -18,31 +18,31 @@ class RepositoryItem extends StatelessWidget {
final String primaryLanguageColor;
final String note;
RepositoryItem(
this.owner,
this.avatarUrl,
this.name,
this.description,
this.starCount,
this.forkCount,
RepositoryItem({
@required this.owner,
@required this.avatarUrl,
@required this.name,
@required this.description,
@required this.starCount,
@required this.forkCount,
this.primaryLanguageName,
this.primaryLanguageColor,
this.note, {
this.note,
this.iconData,
});
RepositoryItem.gh(
this.owner,
this.avatarUrl,
this.name,
this.description,
this.starCount,
this.forkCount,
RepositoryItem.gh({
@required this.owner,
@required this.avatarUrl,
@required this.name,
@required this.description,
@required this.starCount,
@required this.forkCount,
this.primaryLanguageName,
this.primaryLanguageColor,
this.note, {
bool isPrivate,
bool isFork,
this.note,
@required bool isPrivate,
@required bool isFork,
}) : this.iconData = _buildIconData(isPrivate, isFork);
static IconData _buildIconData(bool isPrivate, bool isFork) {