Optimize image cache size

This commit is contained in:
2024-11-10 22:56:18 +08:00
parent a673beb87c
commit 5364aecf74
3 changed files with 37 additions and 15 deletions

View File

@ -23,10 +23,14 @@ class AttachmentItem extends StatelessWidget {
case 'image':
return Hero(
tag: 'attachment-${data.rid}-$heroTag',
child: UniversalImage(
sn.getAttachmentUrl(data.rid),
fit: BoxFit.cover,
),
child: LayoutBuilder(builder: (context, constraints) {
return UniversalImage(
sn.getAttachmentUrl(data.rid),
fit: BoxFit.cover,
cacheHeight: constraints.maxHeight,
cacheWidth: constraints.maxWidth,
);
}),
);
default:
return const Placeholder();