🐛 Fix markdown image in chat close #167

This commit is contained in:
2025-08-16 02:14:44 +08:00
parent 0ab908dd2a
commit 2b80ebc2d0
6 changed files with 42 additions and 32 deletions

View File

@@ -879,7 +879,8 @@ class _LinkPreview extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Favicon and image
if (embed.imageUrl != null || embed.faviconUrl.isNotEmpty)
if (embed.imageUrl != null ||
(embed.faviconUrl?.isNotEmpty ?? false))
Container(
width: 60,
height: 60,
@@ -899,11 +900,14 @@ class _LinkPreview extends ConsumerWidget {
errorBuilder: (context, error, stackTrace) {
return _buildFaviconFallback(
context,
embed.faviconUrl,
embed.faviconUrl ?? '',
);
},
)
: _buildFaviconFallback(context, embed.faviconUrl),
: _buildFaviconFallback(
context,
embed.faviconUrl ?? '',
),
),
),
// Content
@@ -912,9 +916,9 @@ class _LinkPreview extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Site name
if (embed.siteName.isNotEmpty)
if (embed.siteName?.isNotEmpty ?? false)
Text(
embed.siteName,
embed.siteName!,
style: Theme.of(context).textTheme.labelSmall?.copyWith(
color: Theme.of(context).colorScheme.primary,
),