mirror of
https://github.com/git-touch/git-touch
synced 2025-03-08 15:27:40 +01:00
fix: avatar click
This commit is contained in:
parent
a9265c3367
commit
cd38d96a91
@ -133,10 +133,11 @@ class RepositoryScreen extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
GithubAvatar(
|
Avatar(
|
||||||
url: repo.owner.avatarUrl,
|
url: repo.owner.avatarUrl,
|
||||||
size: AvatarSize.small,
|
size: AvatarSize.small,
|
||||||
login: owner),
|
linkUrl: '/$owner',
|
||||||
|
),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
'$owner / $name',
|
'$owner / $name',
|
||||||
|
@ -256,7 +256,7 @@ class UserScreen extends StatelessWidget {
|
|||||||
leftIconData: Octicons.organization,
|
leftIconData: Octicons.organization,
|
||||||
text: TextContainsOrganization(
|
text: TextContainsOrganization(
|
||||||
p.company,
|
p.company,
|
||||||
style: TextStyle(fontSize: 16, color: theme.palette.text),
|
style: TextStyle(fontSize: 17, color: theme.palette.text),
|
||||||
oneLine: true,
|
oneLine: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -25,21 +25,22 @@ class Avatar extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
final widget = ClipRRect(
|
||||||
child: ClipRRect(
|
borderRadius: borderRadius ?? BorderRadius.circular(size / 2),
|
||||||
borderRadius: borderRadius ?? BorderRadius.circular(size / 2),
|
child: FadeInImage.assetNetwork(
|
||||||
child: FadeInImage.assetNetwork(
|
placeholder: 'images/avatar.png',
|
||||||
placeholder: 'images/avatar.png',
|
image: url ?? 'images/avatar.png',
|
||||||
image: url ?? 'images/avatar.png',
|
width: size,
|
||||||
width: size,
|
height: size,
|
||||||
height: size,
|
fadeInDuration: Duration(milliseconds: 200),
|
||||||
fadeInDuration: Duration(milliseconds: 200),
|
fadeOutDuration: Duration(milliseconds: 100),
|
||||||
fadeOutDuration: Duration(milliseconds: 100),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
if (linkUrl == null) return widget;
|
||||||
|
return GestureDetector(
|
||||||
|
child: widget,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (linkUrl != null)
|
Provider.of<ThemeModel>(context).push(context, linkUrl);
|
||||||
Provider.of<ThemeModel>(context).push(context, linkUrl);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -79,7 +80,6 @@ class GitlabAvatar extends StatelessWidget {
|
|||||||
url: url,
|
url: url,
|
||||||
size: size,
|
size: size,
|
||||||
linkUrl: '/user/$id',
|
linkUrl: '/user/$id',
|
||||||
borderRadius: BorderRadius.circular(size / 2),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user