show img size

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-16 17:23:09 +08:00
parent 0c60800b36
commit 88b7f82406
22 changed files with 122 additions and 38 deletions

View File

@@ -624,6 +624,10 @@ class ChatItem extends StatelessWidget {
final url = content['url'];
final imgWidth = (content['width'] as num).toDouble();
final imgHeight = (content['height'] as num).toDouble();
num? size;
if (content['size'] case num value) {
size = value * 1000;
}
final width = math.min(220.0, imgWidth);
final ratio = imgHeight / imgWidth;
Widget child = NetworkImgLayer(
@@ -638,7 +642,9 @@ class ChatItem extends StatelessWidget {
);
}
return GestureDetector(
onTap: () => PageUtils.imageView(imgList: [SourceModel(url: url)]),
onTap: () => PageUtils.imageView(
imgList: [SourceModel(url: url, size: size)],
),
child: child,
);
}