parent
d488f29ddf
commit
5d04c59a35
|
|
@ -14,7 +14,9 @@ class MeetingRoomMsg extends Object{
|
|||
// 0:别人,1:自己
|
||||
int source;
|
||||
|
||||
MeetingRoomMsg(this.uid,this.userName,this.message,this.source);
|
||||
String time;
|
||||
|
||||
MeetingRoomMsg(this.uid,this.userName,this.message,this.source,this.time);
|
||||
|
||||
factory MeetingRoomMsg.fromJson(Map<String, dynamic> srcJson) => _$MeetingRoomMsgFromJson(srcJson);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class MeetingRoomUser extends Object{
|
|||
double? volume = 0.0;
|
||||
|
||||
@JsonKey(name: 'enableShare')
|
||||
bool? enableShare;
|
||||
bool? enableShare = false;
|
||||
|
||||
MeetingRoomUser(this.uid,this.connectId,this.account,this.enableMicr,this.enableCamera,this.screenShareId,this.userName,this.roleId,this.roleName,this.isRoomManager,this.volume,this.enableShare);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
|
||||
import 'package:date_format/date_format.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
|
@ -235,7 +236,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
|
|||
state.remoteUid.value = "";
|
||||
changePageState(1);
|
||||
}
|
||||
update();
|
||||
}
|
||||
} else {
|
||||
if(state.remoteUid.value == UserStore.to.userInfoEntity.value!.screenShareId){
|
||||
|
|
@ -249,6 +249,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
|
|||
}
|
||||
}
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
/// 设置当前全员观看主播
|
||||
|
|
@ -490,8 +491,8 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
|
|||
// var jsonStr = const Utf8Decoder().convert(json.encode(e).runes.toList());
|
||||
var jsonStr = json.encode(e);
|
||||
List list = json.decode(jsonStr);
|
||||
MeetingRoomMsg meetingRoomMsg =
|
||||
MeetingRoomMsg(list[0], list[1], list[2], 0);
|
||||
DateTime dateTime = DateTime.now();
|
||||
MeetingRoomMsg meetingRoomMsg = MeetingRoomMsg(list[0], list[1], list[2], 0, formatDate(dateTime, [HH, ':', nn, ':', ss]));
|
||||
state.meetingRoomMsgs.value.add(meetingRoomMsg);
|
||||
update();
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
|
|
@ -589,11 +590,12 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
|
|||
|
||||
/// 会议室发送消息
|
||||
Future<void> sendMsg(String msg) async {
|
||||
DateTime dateTime = DateTime.now();
|
||||
MeetingRoomMsg meetingRoomMsg = MeetingRoomMsg(
|
||||
UserStore.to.userInfoEntity.value!.uid,
|
||||
UserStore.to.userInfoEntity.value!.userName,
|
||||
msg,
|
||||
1);
|
||||
1, formatDate(dateTime, [HH, ':', nn, ':', ss]));
|
||||
state.meetingRoomMsgs.value.add(meetingRoomMsg);
|
||||
update();
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
|
|
@ -654,6 +656,14 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
|
|||
// 远端用户或主播离开当前会议室回调-主播角色才能接收该回调
|
||||
onUserOffline: (RtcConnection connection, int remoteUid,
|
||||
UserOfflineReasonType reason) async {
|
||||
// 判断是否用户取消了共享
|
||||
if(remoteUid.toString().length == 9){
|
||||
for (var i = 0; i < state.cacheUsers.value.length; i++) {
|
||||
if (remoteUid.toString() == state.cacheUsers.value[i].screenShareId) {
|
||||
state.cacheUsers.value[i].enableShare = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
debugPrint("wgs输出===:RTC-远端用户或主播离开会议室,用户或主机的ID:$remoteUid");
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1136,12 +1136,18 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
|||
ColorUtil.Color_244_244_244),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
state.users.value[index].userName,
|
||||
style: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorUtil.Color_243_243_243),
|
||||
Container(
|
||||
width: 76,
|
||||
margin: const EdgeInsets.only(left: 6),
|
||||
child: Text(
|
||||
state.users.value[index].userName,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorUtil.Color_243_243_243),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.w),
|
||||
Visibility(
|
||||
|
|
@ -1371,10 +1377,23 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
|||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(left: 6),
|
||||
child: Text(
|
||||
state.meetingRoomMsgs.value[index].userName,
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp, color: ColorUtil.Color_202_202_202),
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: state.meetingRoomMsgs.value[index].userName,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp, color: ColorUtil.Color_202_202_202),
|
||||
),
|
||||
TextSpan(
|
||||
text: " ${state.meetingRoomMsgs.value[index].time}",
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp, color: ColorUtil.Color_202_202_202
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
|
@ -1383,9 +1402,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
|||
left: 18, right: 18, top: 10, bottom: 10),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(99),
|
||||
topRight: Radius.circular(99),
|
||||
bottomRight: Radius.circular(99)),
|
||||
bottomLeft: Radius.circular(30),
|
||||
topRight: Radius.circular(30),
|
||||
bottomRight: Radius.circular(30)),
|
||||
color: ColorUtil.Color_53_53_53,
|
||||
),
|
||||
child: Text(
|
||||
|
|
@ -1417,10 +1436,23 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
|||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(right: 6),
|
||||
child: Text(
|
||||
state.meetingRoomMsgs.value[index].userName,
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp, color: ColorUtil.Color_202_202_202),
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: "${state.meetingRoomMsgs.value[index].time} ",
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp, color: ColorUtil.Color_202_202_202
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: state.meetingRoomMsgs.value[index].userName,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp, color: ColorUtil.Color_202_202_202),
|
||||
),
|
||||
],
|
||||
),
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
|
@ -1429,9 +1461,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
|||
left: 18, right: 18, top: 10, bottom: 10),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(99),
|
||||
bottomLeft: Radius.circular(99),
|
||||
bottomRight: Radius.circular(99)),
|
||||
topLeft: Radius.circular(30),
|
||||
bottomLeft: Radius.circular(30),
|
||||
bottomRight: Radius.circular(30)),
|
||||
color: ColorUtil.Color_85_117_242,
|
||||
),
|
||||
child: Text(
|
||||
|
|
@ -1697,6 +1729,8 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
|||
width: 70,
|
||||
child: Text(
|
||||
state.cacheUsers.value[index].userName,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: ColorUtil.Color_255_255_255),
|
||||
|
|
@ -1717,6 +1751,8 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
|||
width: 70,
|
||||
child: Text(
|
||||
state.cacheUsers.value[index].userName,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: ColorUtil.Color_255_255_255),
|
||||
|
|
|
|||
|
|
@ -214,6 +214,14 @@ packages:
|
|||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.3.7"
|
||||
date_format:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: date_format
|
||||
sha256: a48254e60bdb7f1d5a15cac7f86e37491808056c0a99dbdc850841def4754ddc
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.0.9"
|
||||
device_info_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -89,6 +89,9 @@ dependencies:
|
|||
#webview_flutter: ^3.0.4
|
||||
flutter_inappwebview: ^6.1.5
|
||||
|
||||
# 时间组件
|
||||
date_format: ^2.0.9
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
|
|
|||
Loading…
Reference in New Issue