87 lines
2.0 KiB
Dart
87 lines
2.0 KiB
Dart
import 'package:app/widgets/base/transition/slide_hide.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'controls/bottom_bar.dart';
|
|
import 'controls/top_bar.dart';
|
|
import 'video/student_video_list.dart';
|
|
import 'video/teacher_video.dart';
|
|
|
|
class SRoomPage extends StatefulWidget {
|
|
const SRoomPage({super.key});
|
|
|
|
@override
|
|
State<SRoomPage> createState() => _SRoomPageState();
|
|
}
|
|
|
|
class _SRoomPageState extends State<SRoomPage> {
|
|
/// 显示控制栏
|
|
bool _controlsVisible = true;
|
|
|
|
///显示其他学生画面
|
|
bool _showOtherStudent = true;
|
|
|
|
///切换显示控制栏
|
|
void _toggleOverlay() {
|
|
setState(() {
|
|
_controlsVisible = !_controlsVisible;
|
|
});
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Stack(
|
|
children: [
|
|
//底部控制显示
|
|
GestureDetector(
|
|
onTap: _toggleOverlay,
|
|
child: Container(color: Color(0xff2c3032)),
|
|
),
|
|
|
|
//老师视频画面
|
|
TeacherVideo(),
|
|
|
|
Positioned(
|
|
right: 0,
|
|
top: 0,
|
|
bottom: 0,
|
|
child: Visibility(
|
|
visible: _showOtherStudent,
|
|
child: StudentVideoList(),
|
|
),
|
|
),
|
|
|
|
///控制栏
|
|
Positioned(
|
|
top: 0,
|
|
left: 0,
|
|
right: 0,
|
|
child: SlideHide(
|
|
direction: SlideDirection.up,
|
|
hide: !_controlsVisible,
|
|
child: TopBar(
|
|
showOther: _showOtherStudent,
|
|
onOther: () {
|
|
setState(() {
|
|
_showOtherStudent = !_showOtherStudent;
|
|
});
|
|
},
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 0,
|
|
left: 0,
|
|
right: 0,
|
|
child: SlideHide(
|
|
direction: SlideDirection.down,
|
|
hide: !_controlsVisible,
|
|
child: BottomBar(),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|