Browse Source

feat(live): 根据连麦状态动态显示解除连麦选项

- 新增判断是否有嘉宾在连麦的逻辑
- 仅在有嘉宾连麦时显示“解除连麦”功能
- 调整弹窗布局以适应动态内容
- 优化连麦状态变更时的用户体验
ios
Jolie 3 months ago
parent
commit
9b7b3304ba
1 changed files with 37 additions and 23 deletions
  1. 60
      lib/widget/live/live_room_user_header.dart

60
lib/widget/live/live_room_user_header.dart

@ -87,6 +87,13 @@ class LiveRoomUserHeader extends StatelessWidget {
SmartDialog.showAttach(
targetContext: context,
builder: (context) {
//
final hasGuests =
roomController.rtcChannelDetail.value?.maleInfo !=
null ||
roomController.rtcChannelDetail.value?.femaleInfo !=
null;
return Container(
width: 100.w,
margin: EdgeInsets.only(left: 160.w),
@ -97,31 +104,38 @@ class LiveRoomUserHeader extends StatelessWidget {
child: Column(
children: [
SizedBox(height: 15.w),
GestureDetector(
onTap: () {
//
SmartDialog.dismiss();
//
SmartDialog.show(builder: (context){
return DisconnectMicDialog();
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(Assets.imagesMicOff, width: 15.w),
SizedBox(width: 5.w),
Text(
'解除连麦',
style: TextStyle(
color: Colors.white,
fontSize: 13.sp,
// "解除连麦"
if (hasGuests)
GestureDetector(
onTap: () {
//
SmartDialog.dismiss();
//
SmartDialog.show(
builder: (context) {
return DisconnectMicDialog();
},
);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesMicOff,
width: 15.w,
),
),
],
SizedBox(width: 5.w),
Text(
'解除连麦',
style: TextStyle(
color: Colors.white,
fontSize: 13.sp,
),
),
],
),
),
),
SizedBox(height: 15.w),
if (hasGuests) SizedBox(height: 15.w),
GestureDetector(
onTap: () async {
//

Loading…
Cancel
Save