自习室优化ok
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
import 'package:app/pages/student/room/viewmodel/stu_room_vm.dart';
|
||||
import 'package:app/pages/student/room/widgets/status_view.dart';
|
||||
import 'package:app/providers/user_store.dart';
|
||||
import 'package:app/request/dto/room/room_info_dto.dart';
|
||||
import 'package:app/request/dto/room/room_list_item_dto.dart';
|
||||
import 'package:app/widgets/base/transition/slide_hide.dart';
|
||||
import 'package:app/widgets/room/core/count_down_vm.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'controls/bottom_bar.dart';
|
||||
import 'controls/top_bar.dart';
|
||||
import 'video/student_video_list.dart';
|
||||
import 'video/teacher_video.dart';
|
||||
import 'viewmodel/stu_room_vm.dart';
|
||||
|
||||
class SRoomPage extends StatefulWidget {
|
||||
final RoomInfoDto roomInfo;
|
||||
final RoomListItemDto roomInfo;
|
||||
|
||||
const SRoomPage({super.key, required this.roomInfo});
|
||||
|
||||
@@ -36,29 +37,40 @@ class _SRoomPageState extends State<SRoomPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
UserStore userStore = context.read<UserStore>();
|
||||
return ChangeNotifierProvider<StuRoomVM>(
|
||||
create: (_) => StuRoomVM(
|
||||
roomInfo: widget.roomInfo,
|
||||
uid: userStore.userInfo!.id,
|
||||
),
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider<StuRoomVM>(
|
||||
create: (_) => StuRoomVM(
|
||||
info: widget.roomInfo,
|
||||
uid: userStore.userInfo!.id,
|
||||
),
|
||||
),
|
||||
ChangeNotifierProxyProvider<StuRoomVM, CountDownVM>(
|
||||
create: (_) => CountDownVM(),
|
||||
update: (_, stuVM, countDownVM) {
|
||||
countDownVM!.bind(stuVM.roomInfo);
|
||||
return countDownVM;
|
||||
},
|
||||
),
|
||||
],
|
||||
child: Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
//底部控制显示
|
||||
GestureDetector(
|
||||
onTap: _toggleOverlay,
|
||||
child: Container(color: Color(0xff2c3032)),
|
||||
),
|
||||
//老师视频画面
|
||||
TeacherVideo(),
|
||||
|
||||
StatusView(),
|
||||
//其他学生
|
||||
Positioned(
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
child: Visibility(
|
||||
visible: _showOtherStudent,
|
||||
child: StudentVideoList(),
|
||||
child: IgnorePointer(
|
||||
child: Visibility(
|
||||
visible: _showOtherStudent,
|
||||
child: StudentVideoList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -87,7 +99,9 @@ class _SRoomPageState extends State<SRoomPage> {
|
||||
child: SlideHide(
|
||||
direction: SlideDirection.down,
|
||||
hide: !_controlsVisible,
|
||||
child: BottomBar(),
|
||||
child: BottomBar(
|
||||
onTap: _toggleOverlay,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user