From f12299b9d3470f28ec3feef7e50ceb4039b78734 Mon Sep 17 00:00:00 2001 From: Jolie <412895109@qq.com> Date: Tue, 30 Dec 2025 23:27:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(live):=20=E4=BF=AE=E5=A4=8D=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=E9=97=B4=E4=B8=BB=E6=92=AD=E5=B1=95=E7=A4=BA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 onTap 手势识别器从容器外部移到内部,确保点击事件正确响应 - 保持原有的好友状态判断逻辑和礼物弹窗功能 - 修复手势识别器嵌套问题,提升用户交互体验 --- .../live/live_room_anchor_showcase.dart | 88 ++++++++++--------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/lib/widget/live/live_room_anchor_showcase.dart b/lib/widget/live/live_room_anchor_showcase.dart index b0f28d1..413fdfe 100644 --- a/lib/widget/live/live_room_anchor_showcase.dart +++ b/lib/widget/live/live_room_anchor_showcase.dart @@ -97,31 +97,34 @@ class _LiveRoomAnchorShowcaseState extends State { return Positioned( bottom: 5.w, right: 5.w, - child: Container( - width: 47.w, - height: 20.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20.w)), - color: Colors.white, - ), - child: Center( - child: Text( - anchorInfo?.isFriend == true ? '好友' : "加好友", - style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(117, 98, 249, 1), + child: GestureDetector( + onTap: (){ + if(anchorInfo?.isFriend == true){ + return; + } + if (anchorInfo != null) { + _showGiftPopupForUser(anchorInfo, 2); + } + }, + child: Container( + width: 47.w, + height: 20.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20.w)), + color: Colors.white, + ), + child: Center( + child: Text( + anchorInfo?.isFriend == true ? '好友' : "加好友", + style: TextStyle( + fontSize: 11.w, + color: const Color.fromRGBO(117, 98, 249, 1), + ), ), ), ), ), - ).onTap((){ - if(anchorInfo?.isFriend == true){ - return; - } - if (anchorInfo != null) { - _showGiftPopupForUser(anchorInfo, 2); - } - }); + ); }), ], ), @@ -280,30 +283,33 @@ class _LiveRoomAnchorShowcaseState extends State { Positioned( bottom: 5.w, right: 5.w, - child: Container( - width: 47.w, - height: 20.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(20.w), + child: GestureDetector( + onTap: (){ + if(userInfo.isFriend == true){ + return; + } + _showGiftPopupForUser(userInfo, 2); + }, + child: Container( + width: 47.w, + height: 20.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(20.w), + ), + color: Colors.white, ), - color: Colors.white, - ), - child: Center( - child: Text( - userInfo.isFriend != true ? "加好友" : '好友', - style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(117, 98, 249, 1), + child: Center( + child: Text( + userInfo.isFriend != true ? "加好友" : '好友', + style: TextStyle( + fontSize: 11.w, + color: const Color.fromRGBO(117, 98, 249, 1), + ), ), ), ), - ).onTap((){ - if(userInfo.isFriend == true){ - return; - } - _showGiftPopupForUser(userInfo, 2); - }), + ), ), Positioned( left: 5.w,