performance fixes

This commit is contained in:
Salvatore Giordano
2021-06-09 16:11:59 +02:00
parent e567e5f12b
commit dc6c3094e9
26 changed files with 1224 additions and 1158 deletions
@@ -74,16 +74,16 @@ class ImageAttachment extends AttachmentWidget {
if (imageUri.host == 'stream-io-cdn.com') {
imageUri = imageUri.replace(queryParameters: {
...imageUri.queryParameters,
'h': '500',
'w': '500',
'h': '400',
'w': '400',
'crop': 'center',
'resize': 'crop',
});
} else if (imageUri.host == 'stream-cloud-uploads.imgix.net') {
imageUri = imageUri.replace(queryParameters: {
...imageUri.queryParameters,
'height': '500',
'width': '500',
'height': '400',
'width': '400',
'fit': 'crop',
});
}
@@ -92,10 +92,10 @@ class ImageAttachment extends AttachmentWidget {
return _buildImageAttachment(
context,
CachedNetworkImage(
cacheKey: imageUri.path,
cacheKey: imageUrl,
height: size?.height,
width: size?.width,
placeholder: (_, __) {
placeholder: (context, __) {
final image = Image.asset(
'images/placeholder.png',
fit: BoxFit.cover,