Bust cached Telegram avatars
All checks were successful
Build and deploy Flutter Web / build (push) Successful in 1m58s
All checks were successful
Build and deploy Flutter Web / build (push) Successful in 1m58s
This commit is contained in:
@@ -155,6 +155,9 @@ class _UserAvatar extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final photoUrl = user?.photoUrl;
|
final photoUrl = user?.photoUrl;
|
||||||
|
final imageUrl = photoUrl == null || photoUrl.isEmpty
|
||||||
|
? null
|
||||||
|
: _avatarImageUrl(photoUrl);
|
||||||
final fallback = _fallbackText();
|
final fallback = _fallbackText();
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
@@ -185,10 +188,10 @@ class _UserAvatar extends StatelessWidget {
|
|||||||
child: ClipOval(
|
child: ClipOval(
|
||||||
child: SizedBox.square(
|
child: SizedBox.square(
|
||||||
dimension: 44,
|
dimension: 44,
|
||||||
child: photoUrl == null || photoUrl.isEmpty
|
child: imageUrl == null
|
||||||
? _AvatarFallback(text: fallback)
|
? _AvatarFallback(text: fallback)
|
||||||
: Image.network(
|
: Image.network(
|
||||||
photoUrl,
|
imageUrl,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
errorBuilder: (_, _, _) => _AvatarFallback(text: fallback),
|
errorBuilder: (_, _, _) => _AvatarFallback(text: fallback),
|
||||||
),
|
),
|
||||||
@@ -211,6 +214,11 @@ class _UserAvatar extends StatelessWidget {
|
|||||||
|
|
||||||
return 'M';
|
return 'M';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _avatarImageUrl(String photoUrl) {
|
||||||
|
final separator = photoUrl.contains('?') ? '&' : '?';
|
||||||
|
return '$photoUrl${separator}v=2';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum _AvatarAction { logout }
|
enum _AvatarAction { logout }
|
||||||
|
|||||||
Reference in New Issue
Block a user