From ffef4a4e3b6c3c08f2e896f04f511fe12efead9c Mon Sep 17 00:00:00 2001 From: Morn Date: Wed, 21 May 2025 13:38:57 +0800 Subject: [PATCH] fix: make the link align center while sitename is empty (#7955) --- .../link_embed_block_component.dart | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_block_component.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_block_component.dart index de3ea33453..6424aefb16 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_block_component.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/link_embed/link_embed_block_component.dart @@ -188,6 +188,7 @@ class LinkEmbedBlockComponentState Widget buildContent(BuildContext context) { final theme = AppFlowyTheme.of(context), textScheme = theme.textColorScheme; + final hasSiteName = linkInfo.siteName?.isNotEmpty ?? false; return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -231,15 +232,17 @@ class LinkEmbedBlockComponentState crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - FlowyText( - linkInfo.siteName ?? '', - color: textScheme.primary, - fontSize: 14, - figmaLineHeight: 20, - fontWeight: FontWeight.w600, - overflow: TextOverflow.ellipsis, - ), - VSpace(4), + if (hasSiteName) ...[ + FlowyText( + linkInfo.siteName ?? '', + color: textScheme.primary, + fontSize: 14, + figmaLineHeight: 20, + fontWeight: FontWeight.w600, + overflow: TextOverflow.ellipsis, + ), + VSpace(4), + ], FlowyText.regular( url, color: textScheme.secondary,