Skip to content

Commit

Permalink
fix: avatar link
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Jan 30, 2020
1 parent 31e945c commit 9121316
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/screens/gitea_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ class GiteaUserScreen extends StatelessWidget {
starCount: v.starsCount,
forkCount: v.forksCount,
note: 'Updated ${timeago.format(v.updatedAt)}',
url: '/gitea/${v.owner.login}/${v.name}', // TODO:
url: '/gitea/${v.owner.login}/${v.name}',
avatarLink: '/gitea/${v.owner.login}',
)
],
)
Expand Down
6 changes: 5 additions & 1 deletion lib/widgets/repository_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class RepositoryItem extends StatelessWidget {
final String primaryLanguageColor;
final String note;
final String url;
final String avatarLink;

RepositoryItem({
@required this.owner,
Expand All @@ -31,6 +32,7 @@ class RepositoryItem extends StatelessWidget {
this.note,
this.iconData,
@required this.url,
@required this.avatarLink,
});

RepositoryItem.gl({
Expand All @@ -46,6 +48,7 @@ class RepositoryItem extends StatelessWidget {
this.primaryLanguageColor,
this.note,
}) : url = '/gitlab/projects/$id',
avatarLink = '/gitlab/user/$id',
iconData = _buildGlIconData(visibility);

RepositoryItem.gh({
Expand All @@ -61,6 +64,7 @@ class RepositoryItem extends StatelessWidget {
@required bool isPrivate,
@required bool isFork,
}) : iconData = _buildIconData(isPrivate, isFork),
avatarLink = '/$owner',
url = '/$owner/$name';

static IconData _buildIconData(bool isPrivate, bool isFork) {
Expand Down Expand Up @@ -101,7 +105,7 @@ class RepositoryItem extends StatelessWidget {
Avatar(
url: avatarUrl,
size: AvatarSize.small,
linkUrl: '/$owner',
linkUrl: avatarLink,
),
SizedBox(width: 8),
Expanded(
Expand Down

0 comments on commit 9121316

Please sign in to comment.