Rendering stickers inside content

This commit is contained in:
2025-05-11 23:28:04 +08:00
parent e61497dc70
commit 8efd8cd58e
12 changed files with 117 additions and 103 deletions

View File

@ -5,11 +5,16 @@ class UniversalImage extends StatelessWidget {
final String uri;
final String? blurHash;
final BoxFit fit;
final double? width;
final double? height;
const UniversalImage({
super.key,
required this.uri,
this.blurHash,
this.fit = BoxFit.cover,
this.width,
this.height,
});
@override
@ -19,8 +24,8 @@ class UniversalImage extends StatelessWidget {
onElementCreated: (element) {
element as web.HTMLImageElement;
element.src = uri;
element.style.width = '100%';
element.style.height = '100%';
element.style.width = width?.toString() ?? '100%';
element.style.height = height?.toString() ?? '100%';
element.style.objectFit = switch (fit) {
BoxFit.cover || BoxFit.fitWidth || BoxFit.fitHeight => 'cover',
BoxFit.fill => 'fill',