Browse Source

优化

dev-2.0
王子贤 2 months ago
parent
commit
034cc3b2df
3 changed files with 408 additions and 3 deletions
  1. 194
      lib/widget/live/live_room_anchor_showcase.dart
  2. 200
      lib/widget/live/live_room_user_header.dart
  3. 17
      lib/widget/live/live_room_user_profile_dialog.dart

194
lib/widget/live/live_room_anchor_showcase.dart

@ -10,6 +10,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
class LiveRoomAnchorShowcase extends StatefulWidget {
const LiveRoomAnchorShowcase({super.key});
@ -18,10 +19,18 @@ class LiveRoomAnchorShowcase extends StatefulWidget {
State<LiveRoomAnchorShowcase> createState() => _LiveRoomAnchorShowcaseState();
}
class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> with TickerProviderStateMixin {
final RTCManager _rtcManager = RTCManager.instance;
final RoomController _roomController = Get.find<RoomController>();
TabController? _tabController;
@override
void initState() {
super.initState();
_tabController = TabController(length: 3, vsync: this);
}
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<bool>(
@ -384,8 +393,187 @@ class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
_roomController.setDialogDismiss(false);
},
builder: (context) {
return LiveRoomGuestListDialog(
initialTab: isMaleSeat ? 1 : 0, // 0: , 1:
// return LiveRoomGuestListDialog(
// initialTab: isMaleSeat ? 1 : 0, // 0: , 1:
// );
return Material(
borderRadius: BorderRadius.vertical(top: Radius.circular(9.w)),
child: Container(
height: 500.w,
padding: EdgeInsets.symmetric(vertical: 10.w),
child: Column(
children: [
Container(
height: 42.w,
decoration: BoxDecoration(
),
child: TDTabBar(
backgroundColor: Colors.transparent,
tabs: [
TDTab(text: '房间内'),
TDTab(text: '上麦过'),
TDTab(text: '好友'),
],
controller: _tabController,
showIndicator: true,
onTap: (int i) async {
},
),
),
Expanded(
child: Container(
padding: EdgeInsets.all(10.w),
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.symmetric(vertical: 10.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Image.asset(
Assets.imagesUserAvatar,
width: 40.w,
height: 40.w,
),
SizedBox(width: 5.w,),
Column(
children: [
Text(
"开心",
style: TextStyle(
fontSize: 12.w
),
),
Text(
"22岁",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(121, 121, 121, 1)
),
),
],
)
],
),
Checkbox(
value: false,
onChanged: (value) {
},
activeColor: const Color.fromRGBO(117, 98, 249, 1),
side: const BorderSide(color: Colors.grey),
shape: const CircleBorder(),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
],
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 10.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Image.asset(
Assets.imagesUserAvatar,
width: 40.w,
height: 40.w,
),
SizedBox(width: 5.w,),
Column(
children: [
Text(
"开心",
style: TextStyle(
fontSize: 12.w
),
),
Text(
"22岁",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(121, 121, 121, 1)
),
),
],
)
],
),
Checkbox(
value: false,
onChanged: (value) {
},
activeColor: const Color.fromRGBO(117, 98, 249, 1),
side: const BorderSide(color: Colors.grey),
shape: const CircleBorder(),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
],
),
),
],
),
),
)
],
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 170.w,
height: 42.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(42.w)),
color: const Color.fromRGBO(237, 237, 237, 1)
),
child: Center(
child: Text(
"取消",
style: TextStyle(
fontSize: 14.w,
fontWeight: FontWeight.w500
),
),
),
),
Container(
width: 170.w,
height: 42.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(42.w)),
color: const Color.fromRGBO(117, 98, 249, 1)
),
child: Center(
child: Text(
"确认",
style: TextStyle(
fontSize: 14.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
)
],
)
],
),
),
);
},
);

200
lib/widget/live/live_room_user_header.dart

@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
///
class LiveRoomUserHeader extends StatelessWidget {
@ -144,6 +145,205 @@ class LiveRoomUserHeader extends StatelessWidget {
),
),
if (hasGuests) SizedBox(height: 15.w),
GestureDetector(
onTap: () async {
//
FocusScope.of(context).unfocus();
// overlay
SmartDialog.dismiss();
roomController.setDialogDismiss(true);
SmartDialog.show(
alignment: Alignment.bottomCenter,
maskColor: TDTheme.of(context).fontGyColor2,
onDismiss: (){
roomController.setDialogDismiss(false);
},
builder: (_) {
return Material(
borderRadius: BorderRadius.vertical(top: Radius.circular(9.w)),
color: Colors.white,
child: Container(
width: 375.w,
height: 300.w,
padding: EdgeInsets.all(10.w),
child: Column(
children: [
Text(
"在麦用户",
style: TextStyle(
fontSize: 16.w,
fontWeight: FontWeight.w700
),
),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.symmetric(vertical: 10.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Image.asset(
Assets.imagesUserAvatar,
width: 40.w,
height: 40.w,
),
SizedBox(width: 5.w,),
Column(
children: [
Text(
"开心",
style: TextStyle(
fontSize: 12.w
),
),
Text(
"22岁",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(121, 121, 121, 1)
),
),
],
)
],
),
Checkbox(
value: false,
onChanged: (value) {
},
activeColor: const Color.fromRGBO(117, 98, 249, 1),
side: const BorderSide(color: Colors.grey),
shape: const CircleBorder(),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
],
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 10.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Image.asset(
Assets.imagesUserAvatar,
width: 40.w,
height: 40.w,
),
SizedBox(width: 5.w,),
Column(
children: [
Text(
"开心",
style: TextStyle(
fontSize: 12.w
),
),
Text(
"22岁",
style: TextStyle(
fontSize: 12.w,
color: const Color.fromRGBO(121, 121, 121, 1)
),
),
],
)
],
),
Checkbox(
value: false,
onChanged: (value) {
},
activeColor: const Color.fromRGBO(117, 98, 249, 1),
side: const BorderSide(color: Colors.grey),
shape: const CircleBorder(),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
],
),
),
],
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 170.w,
height: 42.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(42.w)),
color: const Color.fromRGBO(237, 237, 237, 1)
),
child: Center(
child: Text(
"取消",
style: TextStyle(
fontSize: 14.w,
fontWeight: FontWeight.w500
),
),
),
),
Container(
width: 170.w,
height: 42.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(42.w)),
color: const Color.fromRGBO(117, 98, 249, 1)
),
child: Center(
child: Text(
"确认",
style: TextStyle(
fontSize: 14.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
)
],
)
],
),
),
);
},
);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesExitRoom,
width: 15.w,
),
SizedBox(width: 5.w),
Text(
'连麦管理',
style: TextStyle(
color: Colors.white,
fontSize: 13.sp,
),
),
],
),
),
SizedBox(height: 15.w),
GestureDetector(
onTap: () async {
await roomController.leaveChannel();

17
lib/widget/live/live_room_user_profile_dialog.dart

@ -1,3 +1,5 @@
import 'package:dating_touchme_app/controller/discover/room_controller.dart';
import 'package:dating_touchme_app/controller/overlay_controller.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/model/live/live_chat_message.dart';
import 'package:dating_touchme_app/pages/message/chat_page.dart';
@ -12,6 +14,11 @@ void showUserProfileDialog(
LiveChatMessage message,
VoidCallback onShowGiftPopup,
) {
final roomController = Get.find<RoomController>();
final overlayController = Get.find<OverlayController>();
final isHost = roomController.currentRole == CurrentRole.broadcaster;
SmartDialog.show(
alignment: Alignment.bottomCenter,
builder: (context) {
@ -128,6 +135,16 @@ void showUserProfileDialog(
SmartDialog.dismiss();
onShowGiftPopup();
}),
if(isHost) Container(
width: 1.w,
height: 12.w,
color: const Color.fromRGBO(229, 229, 229, 1),
margin: EdgeInsets.symmetric(horizontal: 15.w),
),
if(isHost) _buildActionLink('邀请上麦', () {
SmartDialog.dismiss();
onShowGiftPopup();
}),
],
),
],

Loading…
Cancel
Save