feat:增加提醒事项
This commit is contained in:
@@ -6,6 +6,35 @@ import '../provider/app_provider.dart';
|
||||
class AppDrawer extends StatelessWidget {
|
||||
const AppDrawer({super.key});
|
||||
|
||||
DrawerHeader buildDrawerHeader() {
|
||||
return DrawerHeader(
|
||||
decoration: BoxDecoration(color: Colors.blue.shade700),
|
||||
child: const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 30,
|
||||
backgroundColor: Colors.white,
|
||||
child: Icon(Icons.flash_on, color: Colors.blue, size: 40),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Text(
|
||||
'闪灵',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'记录每一刻的灵感',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 14),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
@@ -13,41 +42,7 @@ class AppDrawer extends StatelessWidget {
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
// 抽屉头部
|
||||
DrawerHeader(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue.shade700,
|
||||
),
|
||||
child: const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 30,
|
||||
backgroundColor: Colors.white,
|
||||
child: Icon(
|
||||
Icons.flash_on,
|
||||
color: Colors.blue,
|
||||
size: 40,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Text(
|
||||
'闪灵',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'记录每一刻的灵感',
|
||||
style: TextStyle(
|
||||
color: Colors.white70,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
buildDrawerHeader(),
|
||||
|
||||
// 菜单项
|
||||
_buildDrawerItem(
|
||||
@@ -58,20 +53,12 @@ class AppDrawer extends StatelessWidget {
|
||||
Provider.of<AppProvider>(context, listen: false).changeTab(0);
|
||||
},
|
||||
),
|
||||
_buildDrawerItem(
|
||||
icon: Icons.note,
|
||||
title: '笔记',
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Provider.of<AppProvider>(context, listen: false).changeTab(1);
|
||||
},
|
||||
),
|
||||
_buildDrawerItem(
|
||||
icon: Icons.checklist,
|
||||
title: '待办事项',
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Provider.of<AppProvider>(context, listen: false).changeTab(2);
|
||||
Provider.of<AppProvider>(context, listen: false).changeTab(1);
|
||||
},
|
||||
),
|
||||
_buildDrawerItem(
|
||||
@@ -79,7 +66,7 @@ class AppDrawer extends StatelessWidget {
|
||||
title: '提醒任务',
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Provider.of<AppProvider>(context, listen: false).changeTab(3);
|
||||
Provider.of<AppProvider>(context, listen: false).changeTab(2);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -137,4 +124,4 @@ class AppDrawer extends StatelessWidget {
|
||||
onTap: onTap,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user