This commit is contained in:
zhutao
2025-11-21 18:21:47 +08:00
parent 9c94ee31fd
commit 5784a0a5d4
32 changed files with 734 additions and 441 deletions

View File

@@ -9,7 +9,7 @@ enum RoomCommand {
getRoomInfo("room_data"),
///学生开关扬声器、摄像头、麦克风
switchCamera("mute_self"),
studentActon("mute_self"),
///学生上传文件
uploadFile("upload_file"),
@@ -66,7 +66,7 @@ enum RoomEvent {
handUp("sys_user_handup"),
///自习室以开启,进入自习室(学生用)
openRoom("sys_start_study_room"),
// openRoom("sys_start_study_room"),
///自习室以关闭,退出自习室(学生用)
closeRoom("sys_close_study_room"),
@@ -94,10 +94,10 @@ enum RoomEvent {
const RoomEvent(this.value);
/// 根据 值获取枚举
static RoomEvent fromStr(String value) {
return RoomEvent.values.firstWhere(
(e) => e.value == value,
orElse: () => throw ArgumentError('Invalid weather type value: $value'),
);
static RoomEvent? fromStr(String value) {
for (final e in RoomEvent.values) {
if (e.value == value) return e;
}
return null; // 找不到就返回 null
}
}