chore: update avatar placeholder

This commit is contained in:
Rongjian Zhang 2021-01-30 15:34:41 +08:00
parent 09edf5f04b
commit fc96c5ad45
3 changed files with 5 additions and 41 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -78,8 +78,9 @@ class GlTodosScreen extends StatelessWidget {
padding: CommonStyle.padding,
child: Row(
children: <Widget>[
GitlabAvatar(
url: item.author.avatarUrl, id: item.author.id),
Avatar(
url: item.author.avatarUrl,
linkUrl: '/gitlab/user/${item.author.id}'),
SizedBox(width: 12),
Expanded(
child: Text.rich(

View File

@ -17,6 +17,8 @@ class Avatar extends StatelessWidget {
final String linkUrl;
final BorderRadius borderRadius;
static const fallback = 'images/avatar.png';
Avatar({
@required this.url,
this.size = AvatarSize.medium,
@ -26,7 +28,6 @@ class Avatar extends StatelessWidget {
@override
Widget build(BuildContext context) {
final fallback = 'images/avatar.png';
final widget = ClipRRect(
borderRadius: borderRadius ?? BorderRadius.circular(size / 2),
child: url == null
@ -49,41 +50,3 @@ class Avatar extends StatelessWidget {
);
}
}
class GithubAvatar extends StatelessWidget {
final String url;
final double size;
final String login;
GithubAvatar({
@required this.url,
this.size = AvatarSize.medium,
this.login,
});
@override
Widget build(BuildContext context) {
return Avatar(url: url, size: size, linkUrl: '/github/$login');
}
}
class GitlabAvatar extends StatelessWidget {
final String url;
final double size;
final int id;
GitlabAvatar({
@required this.url,
@required this.id,
this.size = AvatarSize.medium,
});
@override
Widget build(BuildContext context) {
return Avatar(
url: url,
size: size,
linkUrl: '/gitlab/user/$id',
);
}
}