parent
44c789e2f1
commit
5669b0123c
|
|
@ -28,15 +28,13 @@ class MeetingMainPage extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class MeetingMainPageState extends State<MeetingMainPage> {
|
class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
|
|
||||||
final MeetingMainLogic logic = Get.put(MeetingMainLogic());
|
final MeetingMainLogic logic = Get.put(MeetingMainLogic());
|
||||||
final MeetingMainState state = Get.find<MeetingMainLogic>().state;
|
final MeetingMainState state = Get.find<MeetingMainLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
state.floating.value = Floating(
|
state.floating.value = Floating(previewFloatingWidget(),
|
||||||
previewFloatingWidget(),
|
|
||||||
slideType: FloatingSlideType.onRightAndTop,
|
slideType: FloatingSlideType.onRightAndTop,
|
||||||
moveOpacity: 1,
|
moveOpacity: 1,
|
||||||
isShowLog: false,
|
isShowLog: false,
|
||||||
|
|
@ -87,10 +85,11 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
width: 20.w,
|
width: 20.w,
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
onTap: (){
|
onTap: () {
|
||||||
if(state.floating.value?.isShowing == true){
|
if (state.floating.value?.isShowing ==
|
||||||
|
true) {
|
||||||
state.floating.value?.close();
|
state.floating.value?.close();
|
||||||
}else{
|
} else {
|
||||||
state.floating.value?.open(context);
|
state.floating.value?.open(context);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -236,6 +235,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
onHangUpTap: () {
|
onHangUpTap: () {
|
||||||
logic.hangUpVideo();
|
logic.hangUpVideo();
|
||||||
},
|
},
|
||||||
|
onPageViewIndexChange: (index) {
|
||||||
|
|
||||||
|
},
|
||||||
)
|
)
|
||||||
: Container()),
|
: Container()),
|
||||||
|
|
||||||
|
|
@ -1378,22 +1380,22 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 自己视频预览悬浮窗
|
/// 自己视频预览悬浮窗
|
||||||
Widget previewFloatingWidget(){
|
Widget previewFloatingWidget() {
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 120,
|
width: 120,
|
||||||
height: 150,
|
height: 150,
|
||||||
child: Obx(() => Center(
|
child: Obx(() => Center(
|
||||||
child: state.isOpenCamera.value == true
|
child: state.isOpenCamera.value == true
|
||||||
? AgoraVideoView(
|
? AgoraVideoView(
|
||||||
controller: VideoViewController(
|
controller: VideoViewController(
|
||||||
rtcEngine: state.rctEngine.value!,
|
rtcEngine: state.rctEngine.value!,
|
||||||
canvas: const VideoCanvas(uid: 0),
|
canvas: const VideoCanvas(uid: 0),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: const CircularProgressIndicator(),
|
: const CircularProgressIndicator(),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 4,
|
left: 4,
|
||||||
|
|
@ -1408,8 +1410,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
Container(
|
Container(
|
||||||
height: 15,
|
height: 15,
|
||||||
margin: const EdgeInsets.only(left: 4),
|
margin: const EdgeInsets.only(left: 4),
|
||||||
padding:
|
padding: const EdgeInsets.only(left: 4, right: 4),
|
||||||
const EdgeInsets.only(left: 4, right: 4),
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(2),
|
borderRadius: BorderRadius.circular(2),
|
||||||
color: ColorUtil.Color_0_0_0_96),
|
color: ColorUtil.Color_0_0_0_96),
|
||||||
|
|
@ -1422,11 +1423,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
||||||
),
|
),
|
||||||
SizedBox(width: 4.w),*/
|
SizedBox(width: 4.w),*/
|
||||||
Text(
|
Text(
|
||||||
UserStore
|
UserStore.to.userInfoEntity.value!.userName,
|
||||||
.to.userInfoEntity.value!.userName,
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 10.sp,
|
fontSize: 10.sp, color: ColorUtil.Color_185_184_184),
|
||||||
color: ColorUtil.Color_185_184_184),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class MeetingMainVideoState {
|
class MeetingMainVideoState {
|
||||||
MeetingMainVideoState() {
|
MeetingMainVideoState() {
|
||||||
///Initialize variables
|
///Initialize variables
|
||||||
}
|
}
|
||||||
|
|
||||||
|
late RxInt pageIndex = 0.obs;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,15 @@ import 'meeting_main_video_logic.dart';
|
||||||
import 'meeting_main_video_state.dart';
|
import 'meeting_main_video_state.dart';
|
||||||
|
|
||||||
class MeetingMainVideoComponent extends StatefulWidget {
|
class MeetingMainVideoComponent extends StatefulWidget {
|
||||||
const MeetingMainVideoComponent({super.key,
|
const MeetingMainVideoComponent(
|
||||||
required this.rtcEngine,
|
{super.key,
|
||||||
required this.channelId,
|
required this.rtcEngine,
|
||||||
required this.isOpenCamera,
|
required this.channelId,
|
||||||
required this.remoteUid,
|
required this.isOpenCamera,
|
||||||
required this.onHangUpTap,
|
required this.remoteUid,
|
||||||
required this.users});
|
required this.onHangUpTap,
|
||||||
|
required this.users,
|
||||||
|
required this.onPageViewIndexChange});
|
||||||
|
|
||||||
final RtcEngine rtcEngine;
|
final RtcEngine rtcEngine;
|
||||||
final String channelId;
|
final String channelId;
|
||||||
|
|
@ -26,13 +28,14 @@ class MeetingMainVideoComponent extends StatefulWidget {
|
||||||
final bool isOpenCamera;
|
final bool isOpenCamera;
|
||||||
final List<MeetingRoomUser> users;
|
final List<MeetingRoomUser> users;
|
||||||
final Function onHangUpTap;
|
final Function onHangUpTap;
|
||||||
|
final Function onPageViewIndexChange;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MeetingMainVideoComponent> createState() => _MeetingMainVideoComponentState();
|
State<MeetingMainVideoComponent> createState() =>
|
||||||
|
_MeetingMainVideoComponentState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> with AutomaticKeepAliveClientMixin {
|
class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent>{
|
||||||
|
|
||||||
final MeetingMainVideoLogic logic = Get.put(MeetingMainVideoLogic());
|
final MeetingMainVideoLogic logic = Get.put(MeetingMainVideoLogic());
|
||||||
final MeetingMainVideoState state = Get.find<MeetingMainVideoLogic>().state;
|
final MeetingMainVideoState state = Get.find<MeetingMainVideoLogic>().state;
|
||||||
|
|
||||||
|
|
@ -52,8 +55,8 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
||||||
physics: const BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
pageSnapping: true,
|
pageSnapping: true,
|
||||||
onPageChanged: (index) {
|
onPageChanged: (index) {
|
||||||
// 监听事件
|
state.pageIndex.value = index;
|
||||||
debugPrint('wgs输出===:$index');
|
widget.onPageViewIndexChange(index);
|
||||||
},
|
},
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Stack(
|
Stack(
|
||||||
|
|
@ -61,10 +64,9 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
||||||
children: [
|
children: [
|
||||||
widget.remoteUid != ""
|
widget.remoteUid != ""
|
||||||
? AgoraVideoView(
|
? AgoraVideoView(
|
||||||
controller: VideoViewController.remote(
|
controller: VideoViewController(
|
||||||
rtcEngine: widget.rtcEngine,
|
rtcEngine: widget.rtcEngine,
|
||||||
canvas: VideoCanvas(uid: int.tryParse(widget.remoteUid)),
|
canvas: const VideoCanvas(uid: 0)
|
||||||
connection: RtcConnection(channelId: widget.channelId),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: const CircularProgressIndicator(),
|
: const CircularProgressIndicator(),
|
||||||
|
|
@ -156,12 +158,12 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
||||||
color: ColorUtil.Color_0_0_0_96),
|
color: ColorUtil.Color_0_0_0_96),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
*//*Image.asset(
|
*/ /*Image.asset(
|
||||||
'assets/images/meeting_main_microphone_open.png',
|
'assets/images/meeting_main_microphone_open.png',
|
||||||
width: 13.w,
|
width: 13.w,
|
||||||
height: 14.h,
|
height: 14.h,
|
||||||
),
|
),
|
||||||
SizedBox(width: 4.w),*//*
|
SizedBox(width: 4.w),*/ /*
|
||||||
Text(
|
Text(
|
||||||
UserStore
|
UserStore
|
||||||
.to.userInfoEntity.value!.userName,
|
.to.userInfoEntity.value!.userName,
|
||||||
|
|
@ -193,22 +195,23 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
widget.users[index].uid ==
|
widget.users[index].uid ==
|
||||||
UserStore.to.userInfoEntity.value!.uid
|
UserStore.to.userInfoEntity.value!.uid
|
||||||
? AgoraVideoView(
|
? AgoraVideoView(
|
||||||
controller: VideoViewController(
|
controller: VideoViewController(
|
||||||
rtcEngine: widget.rtcEngine,
|
rtcEngine: widget.rtcEngine,
|
||||||
canvas: const VideoCanvas(uid: 0),
|
canvas: const VideoCanvas(uid: 0)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: AgoraVideoView(
|
: AgoraVideoView(
|
||||||
controller: VideoViewController.remote(
|
controller: VideoViewController.remote(
|
||||||
rtcEngine: widget.rtcEngine,
|
rtcEngine: widget.rtcEngine,
|
||||||
canvas: VideoCanvas(
|
canvas: VideoCanvas(
|
||||||
uid: int.tryParse(widget.users[index].uid)),
|
uid: int.tryParse(
|
||||||
connection:
|
widget.users[index].uid)),
|
||||||
RtcConnection(channelId: widget.channelId),
|
connection: RtcConnection(
|
||||||
),
|
channelId: widget.channelId),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 4,
|
left: 4,
|
||||||
bottom: 4,
|
bottom: 4,
|
||||||
|
|
@ -217,57 +220,70 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'assets/images/meeting_main_own.png',
|
'assets/images/meeting_main_own.png',
|
||||||
width: 24.w,
|
width: 24.w,
|
||||||
height: 24 .h,
|
height: 24.h,
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: 20,
|
height: 20,
|
||||||
margin: const EdgeInsets.only(left: 4),
|
margin: const EdgeInsets.only(left: 4),
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.only(left: 4, right: 4),
|
const EdgeInsets.only(left: 4, right: 4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(2),
|
borderRadius: BorderRadius.circular(2),
|
||||||
color: ColorUtil.Color_0_0_0_96),
|
color: ColorUtil.Color_0_0_0_96),
|
||||||
child: widget.users[index].enableMicr == true
|
child: widget.users[index].enableMicr == true
|
||||||
? Row(
|
? Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment:
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
MainAxisAlignment.center,
|
||||||
children: [
|
crossAxisAlignment:
|
||||||
SizedBox(
|
CrossAxisAlignment.center,
|
||||||
width: 20.w,
|
children: [
|
||||||
height: 20.h,
|
SizedBox(
|
||||||
child: LiquidCustomProgressIndicator(
|
width: 20.w,
|
||||||
value: widget.users[index].volume ?? 0.0,
|
height: 20.h,
|
||||||
valueColor: const AlwaysStoppedAnimation(ColorUtil.Color_2_177_136),
|
child: LiquidCustomProgressIndicator(
|
||||||
backgroundColor: ColorUtil.Color_255_255_255,
|
value:
|
||||||
direction: Axis.vertical,
|
widget.users[index]
|
||||||
shapePath: ViewSvgPath.getMicrpphonePath()
|
.volume ??
|
||||||
),
|
0.0,
|
||||||
),
|
valueColor:
|
||||||
Text(
|
const AlwaysStoppedAnimation(
|
||||||
widget.users[index].userName,
|
ColorUtil
|
||||||
style: TextStyle(
|
.Color_2_177_136),
|
||||||
fontSize: 12.sp,
|
backgroundColor:
|
||||||
color: ColorUtil.Color_255_255_255),
|
ColorUtil.Color_255_255_255,
|
||||||
)
|
direction: Axis.vertical,
|
||||||
],
|
shapePath: ViewSvgPath
|
||||||
)
|
.getMicrpphonePath()),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
widget.users[index].userName,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp,
|
||||||
|
color: ColorUtil
|
||||||
|
.Color_255_255_255),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
: Row(
|
: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment:
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
MainAxisAlignment.center,
|
||||||
children: [
|
crossAxisAlignment:
|
||||||
Image.asset(
|
CrossAxisAlignment.center,
|
||||||
'assets/images/meeting_main_microphone_open.png',
|
children: [
|
||||||
width: 20.w,
|
Image.asset(
|
||||||
height: 20.h,
|
'assets/images/meeting_main_microphone_open.png',
|
||||||
),
|
width: 20.w,
|
||||||
Text(
|
height: 20.h,
|
||||||
widget.users[index].userName,
|
),
|
||||||
style: TextStyle(
|
Text(
|
||||||
fontSize: 12.sp,
|
widget.users[index].userName,
|
||||||
color: ColorUtil.Color_255_255_255),
|
style: TextStyle(
|
||||||
)
|
fontSize: 12.sp,
|
||||||
],
|
color: ColorUtil
|
||||||
),
|
.Color_255_255_255),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -288,7 +304,9 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
||||||
margin: const EdgeInsets.only(right: 6),
|
margin: const EdgeInsets.only(right: 6),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
color: ColorUtil.Color_255_255_255),
|
color: state.pageIndex.value == 0
|
||||||
|
? ColorUtil.Color_255_255_255
|
||||||
|
: ColorUtil.Color_108_108_108),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
width: 8.w,
|
width: 8.w,
|
||||||
|
|
@ -296,7 +314,9 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
||||||
margin: const EdgeInsets.only(left: 6),
|
margin: const EdgeInsets.only(left: 6),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
color: ColorUtil.Color_108_108_108),
|
color: state.pageIndex.value == 1
|
||||||
|
? ColorUtil.Color_255_255_255
|
||||||
|
: ColorUtil.Color_108_108_108),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -304,8 +324,4 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
bool get wantKeepAlive => true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue