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