Files
food_hub_app/lib/layout/app_drawer.dart
2025-11-23 00:02:41 +08:00

45 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_common/layout/theme_layout.dart';
class AppDrawer extends StatefulWidget {
const AppDrawer({super.key});
@override
State<StatefulWidget> createState() => AppDrawerState();
}
class AppDrawerState extends State<AppDrawer> {
@override
Widget build(BuildContext context) {
// final themeProvider = Provider.of<ThemeProvider>(context);
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: [
ConstrainedBox(
constraints: const BoxConstraints(maxHeight: 100),
child: DrawerHeader(
decoration: BoxDecoration(color: Theme.of(context).primaryColor),
child: const Text(
'设置',
style: TextStyle(color: Colors.white, fontSize: 24),
),
),
),
ThemeLayout(),
const Divider(),
ListTile(
leading: const Icon(Icons.info),
title: const Text('关于我们'),
onTap: () {
Navigator.pop(context); // 关闭抽屉
// 跳转到关于页面
},
),
],
),
);
}
}