1
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import 'package:app/config/theme/base/app_theme_ext.dart';
|
||||
import 'package:app/request/api/room_api.dart';
|
||||
import 'package:app/request/dto/room/room_type_dto.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'today/s_today_card.dart';
|
||||
@@ -12,6 +14,8 @@ class SHomePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SHomePageState extends State<SHomePage> {
|
||||
|
||||
|
||||
///刷新状态
|
||||
Future<void> _refresh() async {
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
|
||||
@@ -16,7 +16,6 @@ class STodayCard extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _STodayCardState extends State<STodayCard> {
|
||||
|
||||
///进入自习室
|
||||
void _handleEnterRoom() {
|
||||
context.push(RoutePaths.sRoom);
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import 'package:app/providers/user_store.dart';
|
||||
import 'package:app/router/route_paths.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:remixicon/remixicon.dart';
|
||||
|
||||
class UserHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
@@ -34,7 +38,28 @@ class UserHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
PopupMenuButton(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.zero,
|
||||
position: PopupMenuPosition.under,
|
||||
onSelected: (value) {
|
||||
if (value == 1) {
|
||||
UserStore userStore = context.read<UserStore>();
|
||||
userStore.logout();
|
||||
context.go(RoutePaths.login);
|
||||
}
|
||||
},
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
value: 1,
|
||||
child: Text("退出登录", textAlign: TextAlign.center),
|
||||
),
|
||||
],
|
||||
child: IconButton(
|
||||
onPressed: null,
|
||||
icon: Icon(RemixIcons.user_line),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user