parent
b3ff943f1c
commit
1cabad280c
|
|
@ -19,7 +19,6 @@ class HomePage extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
|
class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
|
||||||
|
|
||||||
final logic = Get.put(HomeLogic());
|
final logic = Get.put(HomeLogic());
|
||||||
final state = Get.find<HomeLogic>().state;
|
final state = Get.find<HomeLogic>().state;
|
||||||
|
|
||||||
|
|
@ -34,6 +33,184 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
super.build(context);
|
||||||
|
return PopScope(
|
||||||
|
canPop: false,
|
||||||
|
onPopInvoked: (bool didPop) async {
|
||||||
|
if (didPop) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
SystemNavigator.pop();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
surfaceTintColor: Colors.white,
|
||||||
|
elevation: 0,
|
||||||
|
toolbarHeight: 0,
|
||||||
|
systemOverlayStyle: const SystemUiOverlayStyle(
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
systemNavigationBarColor: Color(0xFF000000),
|
||||||
|
systemNavigationBarIconBrightness: Brightness.light,
|
||||||
|
statusBarIconBrightness: Brightness.dark,
|
||||||
|
statusBarBrightness: Brightness.light,
|
||||||
|
),
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
),
|
||||||
|
body: Obx(() => Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 44.h,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Text(
|
||||||
|
'会议列表',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.sp,
|
||||||
|
color: ColorUtil.Color_51_51_51,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
color: ColorUtil.Color_244_244_244,
|
||||||
|
child: SmartRefresher(
|
||||||
|
enablePullUp: true,
|
||||||
|
controller: state.refreshController,
|
||||||
|
onRefresh: logic.onRefresh,
|
||||||
|
onLoading: logic.onLoading,
|
||||||
|
child: ListView.builder(
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.all(Radius.circular(6)),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.only(
|
||||||
|
top: index == 0 ? 20 : 12,
|
||||||
|
bottom: index == 19 ? 20 : 0,
|
||||||
|
left: 16,
|
||||||
|
right: 16),
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
state.meetingRooms.value[index].roomName,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
color: ColorUtil.Color_89_88_88,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
'assets/images/index_persons.png',
|
||||||
|
width: 16.w,
|
||||||
|
height: 16.h,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${state.meetingRooms.value[index].onlineUserCount}人',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp,
|
||||||
|
color: ColorUtil.Color_177_177_177,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 20.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
state.meetingRooms.value[index]
|
||||||
|
.roomNum,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp,
|
||||||
|
color: ColorUtil.Color_177_177_177,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 6.w),
|
||||||
|
GestureDetector(
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/index_copy.png',
|
||||||
|
width: 16.w,
|
||||||
|
height: 16.h,
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Clipboard.setData(ClipboardData(
|
||||||
|
text: state.meetingRooms
|
||||||
|
.value[index].roomNum));
|
||||||
|
ToastUtils.showSuccess("复制成功");
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
child: Container(
|
||||||
|
width: 78.w,
|
||||||
|
height: 30.h,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: const BorderRadius.all(
|
||||||
|
Radius.circular(6)),
|
||||||
|
color: ColorUtil.Color_85_117_242,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'进入',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'assets/images/index_right.png',
|
||||||
|
width: 16.w,
|
||||||
|
height: 16.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(Routes.meetingMainPage,
|
||||||
|
arguments: {
|
||||||
|
"roomNumber": state.meetingRooms
|
||||||
|
.value[index].roomNum
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: state.meetingRooms.value.length,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
))),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|
@ -51,142 +228,155 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
),
|
),
|
||||||
body: Obx(() => Column(
|
body: Obx(() => Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.h,
|
height: 44.h,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Text(
|
child: Text(
|
||||||
'会议列表',
|
'会议列表',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16.sp,
|
fontSize: 16.sp,
|
||||||
color: ColorUtil.Color_51_51_51,
|
color: ColorUtil.Color_51_51_51,
|
||||||
fontWeight: FontWeight.w500
|
fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
),
|
child: Container(
|
||||||
Expanded(
|
color: ColorUtil.Color_244_244_244,
|
||||||
child: Container(
|
child: SmartRefresher(
|
||||||
color: ColorUtil.Color_244_244_244,
|
enablePullUp: true,
|
||||||
child: SmartRefresher(
|
controller: state.refreshController,
|
||||||
enablePullUp: true,
|
onRefresh: logic.onRefresh,
|
||||||
controller: state.refreshController,
|
onLoading: logic.onLoading,
|
||||||
onRefresh: logic.onRefresh,
|
child: ListView.builder(
|
||||||
onLoading: logic.onLoading,
|
itemBuilder: (context, index) {
|
||||||
child: ListView.builder(
|
return Container(
|
||||||
itemBuilder: (context, index) {
|
width: double.infinity,
|
||||||
return Container(
|
decoration: const BoxDecoration(
|
||||||
width: double.infinity,
|
borderRadius:
|
||||||
decoration: const BoxDecoration(
|
BorderRadius.all(Radius.circular(6)),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6)),
|
color: Colors.white,
|
||||||
color: Colors.white,
|
),
|
||||||
),
|
margin: EdgeInsets.only(
|
||||||
margin: EdgeInsets.only(top: index == 0 ? 20 : 12, bottom: index == 19 ? 20 : 0, left: 16, right: 16),
|
top: index == 0 ? 20 : 12,
|
||||||
padding: const EdgeInsets.all(12),
|
bottom: index == 19 ? 20 : 0,
|
||||||
child: Column(
|
left: 16,
|
||||||
children: [
|
right: 16),
|
||||||
Row(
|
padding: const EdgeInsets.all(12),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
|
||||||
state.meetingRooms.value[index].roomName,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.sp,
|
|
||||||
color: ColorUtil.Color_89_88_88,
|
|
||||||
fontWeight: FontWeight.w500
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Row(
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
|
||||||
'assets/images/index_persons.png',
|
|
||||||
width: 16.w,
|
|
||||||
height: 16.h,
|
|
||||||
),
|
|
||||||
Text(
|
Text(
|
||||||
'${state.meetingRooms.value[index].onlineUserCount}人',
|
state.meetingRooms.value[index].roomName,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12.sp,
|
fontSize: 14.sp,
|
||||||
color: ColorUtil.Color_177_177_177,
|
color: ColorUtil.Color_89_88_88,
|
||||||
),
|
fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
'assets/images/index_persons.png',
|
||||||
|
width: 16.w,
|
||||||
|
height: 16.h,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${state.meetingRooms.value[index].onlineUserCount}人',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp,
|
||||||
|
color: ColorUtil.Color_177_177_177,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 20.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
state.meetingRooms.value[index]
|
||||||
|
.roomNum,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp,
|
||||||
|
color: ColorUtil.Color_177_177_177,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 6.w),
|
||||||
|
GestureDetector(
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/index_copy.png',
|
||||||
|
width: 16.w,
|
||||||
|
height: 16.h,
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Clipboard.setData(ClipboardData(
|
||||||
|
text: state.meetingRooms
|
||||||
|
.value[index].roomNum));
|
||||||
|
ToastUtils.showSuccess("复制成功");
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
child: Container(
|
||||||
|
width: 78.w,
|
||||||
|
height: 30.h,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: const BorderRadius.all(
|
||||||
|
Radius.circular(6)),
|
||||||
|
color: ColorUtil.Color_85_117_242,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'进入',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'assets/images/index_right.png',
|
||||||
|
width: 16.w,
|
||||||
|
height: 16.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(Routes.meetingMainPage,
|
||||||
|
arguments: {
|
||||||
|
"roomNumber": state.meetingRooms
|
||||||
|
.value[index].roomNum
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 20.h),
|
);
|
||||||
Row(
|
},
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
itemCount: state.meetingRooms.value.length,
|
||||||
children: [
|
),
|
||||||
Row(
|
),
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
state.meetingRooms.value[index].roomNum,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12.sp,
|
|
||||||
color: ColorUtil.Color_177_177_177,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 6.w),
|
|
||||||
GestureDetector(
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/images/index_copy.png',
|
|
||||||
width: 16.w,
|
|
||||||
height: 16.h,
|
|
||||||
),
|
|
||||||
onTap: (){
|
|
||||||
Clipboard.setData(ClipboardData(text: state.meetingRooms.value[index].roomNum));
|
|
||||||
ToastUtils.showSuccess("复制成功");
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
GestureDetector(
|
|
||||||
child: Container(
|
|
||||||
width: 78.w,
|
|
||||||
height: 30.h,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
|
||||||
color: ColorUtil.Color_85_117_242,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'进入',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12.sp,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Image.asset(
|
|
||||||
'assets/images/index_right.png',
|
|
||||||
width: 16.w,
|
|
||||||
height: 16.h,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: (){
|
|
||||||
Get.toNamed(Routes.meetingMainPage, arguments: {"roomNumber": state.meetingRooms.value[index].roomNum});
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
itemCount: state.meetingRooms.value.length,
|
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
),
|
],
|
||||||
)
|
)));
|
||||||
],
|
}*/
|
||||||
))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ class LoginLogic extends GetxController with RequestToolMixin {
|
||||||
if (null != res.data) {
|
if (null != res.data) {
|
||||||
UserStore.to.setToken(res.data!.token);
|
UserStore.to.setToken(res.data!.token);
|
||||||
UserStore.to.setUserDetailInfo(res.data!);
|
UserStore.to.setUserDetailInfo(res.data!);
|
||||||
Get.toNamed(Routes.startPage);
|
// Get.toNamed(Routes.startPage);
|
||||||
|
Get.offAllNamed(Routes.startPage);
|
||||||
}
|
}
|
||||||
}finally{
|
}finally{
|
||||||
ToastUtils.dismiss();
|
ToastUtils.dismiss();
|
||||||
|
|
@ -77,7 +78,8 @@ class LoginLogic extends GetxController with RequestToolMixin {
|
||||||
if (null != res.data) {
|
if (null != res.data) {
|
||||||
UserStore.to.setToken(res.data!.token);
|
UserStore.to.setToken(res.data!.token);
|
||||||
UserStore.to.setUserDetailInfo(res.data!);
|
UserStore.to.setUserDetailInfo(res.data!);
|
||||||
Get.toNamed(Routes.meetingMainPage, arguments: {"roomNumber": state.meetingCodeController.text});
|
// Get.toNamed(Routes.meetingMainPage, arguments: {"roomNumber": state.meetingCodeController.text});
|
||||||
|
Get.offAllNamed(Routes.startPage, arguments: {"roomNumber": state.meetingCodeController.text});
|
||||||
}
|
}
|
||||||
}finally{
|
}finally{
|
||||||
ToastUtils.dismiss();
|
ToastUtils.dismiss();
|
||||||
|
|
|
||||||
|
|
@ -351,7 +351,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
|
||||||
state.isOpenMicrophone.value = false;
|
state.isOpenMicrophone.value = false;
|
||||||
state.isOpenCamera.value = false;
|
state.isOpenCamera.value = false;
|
||||||
state.isOpenShare.value = false;
|
state.isOpenShare.value = false;
|
||||||
state.remoteUid.value = "";
|
|
||||||
|
|
||||||
// 设置声网SDK角色为观众
|
// 设置声网SDK角色为观众
|
||||||
setClientRole("观众");
|
setClientRole("观众");
|
||||||
|
|
@ -362,7 +361,10 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
|
||||||
// 关闭本地预览悬浮窗
|
// 关闭本地预览悬浮窗
|
||||||
state.floating.value?.close();
|
state.floating.value?.close();
|
||||||
// 切换页面状态
|
// 切换页面状态
|
||||||
changePageState(0);
|
if(state.remoteUid.value == UserStore.to.userInfoEntity.value!.uid){
|
||||||
|
state.remoteUid.value = "";
|
||||||
|
changePageState(0);
|
||||||
|
}
|
||||||
// 停止共享屏幕(此版本不做)
|
// 停止共享屏幕(此版本不做)
|
||||||
// stopScreenCapture();
|
// stopScreenCapture();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,6 @@ class UserLogic extends GetxController with RequestToolMixin {
|
||||||
/// 退出登录
|
/// 退出登录
|
||||||
void logout(){
|
void logout(){
|
||||||
UserStore.to.erase();
|
UserStore.to.erase();
|
||||||
Get.offAllNamed(Routes.loginPage);
|
Get.toNamed(Routes.loginPage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue