老师端几乎ok
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
import 'package:app/request/dto/room/room_user_dto.dart';
|
||||
import 'package:app/widgets/room/file_drawer.dart';
|
||||
import 'package:app/widgets/room/video_surface.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:remixicon/remixicon.dart';
|
||||
|
||||
import '../viewmodel/students_view_model.dart';
|
||||
|
||||
class StudentItem extends StatefulWidget {
|
||||
const StudentItem({super.key});
|
||||
final RoomUserDto user;
|
||||
|
||||
const StudentItem({
|
||||
super.key,
|
||||
required this.user,
|
||||
});
|
||||
|
||||
@override
|
||||
State<StudentItem> createState() => _StudentItemState();
|
||||
@@ -12,11 +21,18 @@ class StudentItem extends StatefulWidget {
|
||||
|
||||
class _StudentItemState extends State<StudentItem> {
|
||||
///打开文件列表
|
||||
void _openFileList(){
|
||||
showFileDialog(context,isUpload: false);
|
||||
void _openFileList() {
|
||||
showFileDialog(context, isUpload: false);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final vm = context.read<StudentsViewModel>();
|
||||
//摄像头是否开启
|
||||
bool isCameraOpen = widget.user.cameraStatus == 1;
|
||||
|
||||
///麦克风是否开启
|
||||
bool isMicOpen = widget.user.microphoneStatus == 1;
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: Container(
|
||||
@@ -28,8 +44,7 @@ class _StudentItemState extends State<StudentItem> {
|
||||
width: double.infinity,
|
||||
child: Stack(
|
||||
children: [
|
||||
VideoSurface(
|
||||
),
|
||||
// VideoSurface(),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
@@ -44,14 +59,31 @@ class _StudentItemState extends State<StudentItem> {
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
"李明辉",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
),
|
||||
widget.user.userName,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.user.userId != vm.activeSId)
|
||||
Positioned(
|
||||
right: 5,
|
||||
top: 5,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
vm.selectStudent(widget.user.userId);
|
||||
},
|
||||
child: Container(
|
||||
width: 25,
|
||||
height: 25,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black12,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Icon(RemixIcons.fullscreen_line, color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -60,17 +92,18 @@ class _StudentItemState extends State<StudentItem> {
|
||||
color: Color(0xFF232426),
|
||||
child: Row(
|
||||
children: [
|
||||
_actionItem(icon: RemixIcons.video_on_fill, isActive: false),
|
||||
_actionItem(
|
||||
icon: RemixIcons.mic_off_fill,
|
||||
icon: isCameraOpen ? RemixIcons.video_on_fill : RemixIcons.video_off_fill,
|
||||
isActive: isCameraOpen,
|
||||
),
|
||||
_actionItem(
|
||||
icon: RemixIcons.volume_mute_fill,
|
||||
),
|
||||
_actionItem(
|
||||
icon: RemixIcons.file_list_3_fill,
|
||||
onTap: _openFileList
|
||||
icon: isMicOpen ? RemixIcons.mic_fill : RemixIcons.mic_off_fill,
|
||||
isActive: isMicOpen,
|
||||
),
|
||||
// _actionItem(
|
||||
// icon: RemixIcons.volume_mute_fill,
|
||||
// ),
|
||||
_actionItem(icon: RemixIcons.file_list_3_fill, onTap: _openFileList),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user