70 lines
2.0 KiB
Dart
70 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class SettingsDrawer extends StatelessWidget {
|
|
const SettingsDrawer({super.key});
|
|
|
|
@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),
|
|
),
|
|
),
|
|
),
|
|
ListTile(
|
|
leading: const Icon(Icons.brightness_4),
|
|
title: const Text('夜间模式'),
|
|
// trailing: Switch(
|
|
// value: themeProvider.isDarkMode,
|
|
// onChanged: (bool value) {
|
|
// themeProvider.toggleTheme();
|
|
// },
|
|
// ),
|
|
// onTap: () => themeProvider.toggleTheme(),
|
|
),
|
|
|
|
// 其他设置选项
|
|
ListTile(
|
|
leading: const Icon(Icons.notifications),
|
|
title: const Text('通知设置'),
|
|
onTap: () {
|
|
Navigator.pop(context); // 关闭抽屉
|
|
// 跳转到通知设置页面
|
|
},
|
|
),
|
|
|
|
ListTile(
|
|
leading: const Icon(Icons.language),
|
|
title: const Text('语言'),
|
|
onTap: () {
|
|
Navigator.pop(context); // 关闭抽屉
|
|
// 跳转到语言设置页面
|
|
},
|
|
),
|
|
|
|
// 底部关于
|
|
const Divider(),
|
|
ListTile(
|
|
leading: const Icon(Icons.info),
|
|
title: const Text('关于我们'),
|
|
onTap: () {
|
|
Navigator.pop(context); // 关闭抽屉
|
|
// 跳转到关于页面
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|