Browse Source

fix(live): 修复直播间主播展示组件的点击事件处理

- 将 onTap 手势识别器从容器外部移到内部,确保点击事件正确响应
- 保持原有的好友状态判断逻辑和礼物弹窗功能
- 修复手势识别器嵌套问题,提升用户交互体验
master
Jolie 3 months ago
parent
commit
f12299b9d3
1 changed files with 47 additions and 41 deletions
  1. 88
      lib/widget/live/live_room_anchor_showcase.dart

88
lib/widget/live/live_room_anchor_showcase.dart

@ -97,31 +97,34 @@ class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
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<LiveRoomAnchorShowcase> {
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,

Loading…
Cancel
Save