本地预览悬浮窗
This commit is contained in:
parent
5d194ad054
commit
44c789e2f1
|
|
@ -2,11 +2,8 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:wgshare/main.dart';
|
||||
import 'package:wgshare/utils/my_text.dart';
|
||||
import 'package:wgshare/utils/utils.dart';
|
||||
|
||||
import '../../routes/app_routes.dart';
|
||||
import '../../utils/color_util.dart';
|
||||
import 'login_logic.dart';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:signalr_core/signalr_core.dart';
|
||||
|
|
@ -33,6 +34,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
state.floating.value?.close();
|
||||
state.memberNameSearchController.dispose();
|
||||
state.sendMsgController.dispose();
|
||||
stopTime();
|
||||
|
|
@ -311,7 +313,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
doHttpSetMicr();
|
||||
});
|
||||
|
||||
/// 单独用户开闭麦回调
|
||||
/// 用户单独开闭麦回调
|
||||
state.hubConnection.value?.on("OperMicr", (e){
|
||||
// var jsonStr = const Utf8Decoder().convert(json.encode(e?[0]).runes.toList());
|
||||
var jsonStr = json.encode(e?[0]);
|
||||
|
|
@ -406,7 +408,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
});
|
||||
|
||||
/// ------------------------------------------------------------------------------摄像头或者屏幕相关回调
|
||||
/// 单独用户开闭摄像头回调
|
||||
/// 用户单独开闭摄像头回调
|
||||
state.hubConnection.value?.on("OperCamera", (e){
|
||||
// var jsonStr = const Utf8Decoder().convert(json.encode(e?[0]).runes.toList());
|
||||
var jsonStr = json.encode(e?[0]);
|
||||
|
|
@ -425,7 +427,8 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
muteLocalVideoStream(false);
|
||||
// 开始本地预览
|
||||
startPreview();
|
||||
|
||||
// 打开本地预览悬浮窗
|
||||
state.floating.value?.open(state.context.value!);
|
||||
changePageState(1);
|
||||
}
|
||||
}else{
|
||||
|
|
@ -442,6 +445,8 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
muteLocalVideoStream(true);
|
||||
// 停止本地预览
|
||||
stopPreview();
|
||||
// 关闭本地预览悬浮窗
|
||||
state.floating.value?.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'dart:async';
|
|||
|
||||
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_floating/floating/floating.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_rx/src/rx_types/rx_types.dart';
|
||||
import 'package:signalr_core/signalr_core.dart';
|
||||
|
|
@ -18,6 +19,8 @@ class MeetingMainState {
|
|||
|
||||
late TextEditingController memberNameSearchController = TextEditingController();
|
||||
late TextEditingController sendMsgController = TextEditingController();
|
||||
late Rx<Floating?> floating = Rx(null);
|
||||
late Rx<BuildContext?> context = Rx(null);
|
||||
|
||||
/// 是否显示会议信息浮层
|
||||
late RxBool isShowMeetingInfoFloatingLayer = false.obs;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -12,7 +12,7 @@ import 'meeting_main_video_logic.dart';
|
|||
import 'meeting_main_video_state.dart';
|
||||
|
||||
class MeetingMainVideoComponent extends StatefulWidget {
|
||||
MeetingMainVideoComponent({super.key,
|
||||
const MeetingMainVideoComponent({super.key,
|
||||
required this.rtcEngine,
|
||||
required this.channelId,
|
||||
required this.isOpenCamera,
|
||||
|
|
@ -115,7 +115,7 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
|||
),
|
||||
|
||||
/// 右上角小窗
|
||||
Visibility(
|
||||
/*Visibility(
|
||||
visible: widget.isOpenCamera,
|
||||
child: Positioned(
|
||||
top: 58,
|
||||
|
|
@ -156,12 +156,12 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
|||
color: ColorUtil.Color_0_0_0_96),
|
||||
child: Row(
|
||||
children: [
|
||||
/*Image.asset(
|
||||
*//*Image.asset(
|
||||
'assets/images/meeting_main_microphone_open.png',
|
||||
width: 13.w,
|
||||
height: 14.h,
|
||||
),
|
||||
SizedBox(width: 4.w),*/
|
||||
SizedBox(width: 4.w),*//*
|
||||
Text(
|
||||
UserStore
|
||||
.to.userInfoEntity.value!.userName,
|
||||
|
|
@ -178,7 +178,7 @@ class _MeetingMainVideoComponentState extends State<MeetingMainVideoComponent> w
|
|||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
)*/
|
||||
],
|
||||
),
|
||||
Container(
|
||||
|
|
|
|||
|
|
@ -315,6 +315,14 @@ packages:
|
|||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "3.0.5"
|
||||
flutter_floating:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_floating
|
||||
sha256: "0ff6a47c29a213c426005d248c6afe93fa76e308abbbbd6c8a35689daf11a997"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.0.8"
|
||||
flutter_hooks:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -79,6 +79,9 @@ dependencies:
|
|||
# 水波效果的进度器
|
||||
liquid_progress_indicator_v2: ^0.5.0
|
||||
|
||||
# 悬浮拖动组件
|
||||
flutter_floating: ^1.0.7
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
|
|
|||
Loading…
Reference in New Issue