初始化

This commit is contained in:
zhutao
2025-11-19 17:56:39 +08:00
commit 1b28239352
115 changed files with 5440 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
/// 视频画面显示状态
enum VideoState {
/// 正常显示视频
normal,
/// 摄像头关闭
closed,
/// 掉线 / 未连接
offline,
/// 加载中(进房、拉流等)
loading,
/// 错误状态(拉流失败等)
error,
}
class VideoSurface extends StatelessWidget {
final VideoState state;
const VideoSurface({super.key, this.state = VideoState.normal});
@override
Widget build(BuildContext context) {
String stateText = switch (state) {
VideoState.closed => "摄像头已关闭",
VideoState.offline => "掉线",
VideoState.loading => "加载中",
VideoState.error => "错误",
_ => "未知",
};
//如果不是正常
if (state != VideoState.normal) {
return Align(
child: Text(stateText, style: TextStyle(color: Colors.white70)),
);
}
return Container();
}
}