From 8e58edd0ac7903931cc65a0067d5984dbe5ba1e3 Mon Sep 17 00:00:00 2001 From: Jolie <412895109@qq.com> Date: Thu, 4 Dec 2025 00:24:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(message):=20=E4=BF=AE=E5=A4=8D=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E5=88=97=E8=A1=A8=E5=A4=B4=E5=83=8F=E5=92=8C=E6=98=B5?= =?UTF-8?q?=E7=A7=B0=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除头像图片的本地资源兜底逻辑,统一使用网络图片 - 简化昵称显示逻辑,优先显示昵称,否则显示空字符串 - 移除冗余的空值检查和类型转换代码 --- lib/pages/message/conversation_tab.dart | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/pages/message/conversation_tab.dart b/lib/pages/message/conversation_tab.dart index e8fcda5..57682de 100644 --- a/lib/pages/message/conversation_tab.dart +++ b/lib/pages/message/conversation_tab.dart @@ -109,12 +109,7 @@ class _ConversationTabState extends State decoration: BoxDecoration( borderRadius: BorderRadius.circular(28), image: DecorationImage( - image: (userInfo?.avatarUrl?.isNotEmpty ?? false) - ? NetworkImage(userInfo!.avatarUrl!) - : const AssetImage( - Assets.imagesAvatarsExample, - ) - as ImageProvider, + image: NetworkImage(userInfo!.avatarUrl!), fit: BoxFit.cover, ), ), @@ -131,9 +126,7 @@ class _ConversationTabState extends State children: [ Expanded( child: Text( - (userInfo?.nickName?.isNotEmpty ?? false) - ? userInfo!.nickName! - : conversation.id, // 如果没有昵称,显示用户ID + userInfo.nickName ?? '', // 如果没有昵称,显示用户ID style: const TextStyle( fontSize: 16, fontWeight: FontWeight.w500,