feat:增加统计图表模块
This commit is contained in:
@@ -86,28 +86,62 @@ class AppDrawer extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildVersionInfo({
|
||||
required BuildContext context,
|
||||
required String fullVersion,
|
||||
}) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(top: BorderSide(color: Colors.grey.shade300)),
|
||||
),
|
||||
child: Text(
|
||||
'版本 v$fullVersion',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appProvider = Provider.of<AppProvider>(context);
|
||||
|
||||
return Drawer(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Column(
|
||||
children: [
|
||||
// 抽屉头部
|
||||
buildDrawerHeader(context),
|
||||
// 主要内容区域,可以滚动
|
||||
Expanded(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
// 抽屉头部
|
||||
buildDrawerHeader(context),
|
||||
_buildThemeSection(context, appProvider),
|
||||
const Divider(),
|
||||
_buildDrawerItem(
|
||||
context: context,
|
||||
icon: Icons.help,
|
||||
title: '帮助与反馈',
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
// 这里可以导航到帮助页面
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
_buildThemeSection(context, appProvider),
|
||||
|
||||
const Divider(),
|
||||
|
||||
_buildDrawerItem(
|
||||
context: context,
|
||||
icon: Icons.help,
|
||||
title: '帮助与反馈',
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
// 这里可以导航到帮助页面
|
||||
Consumer<AppProvider>(
|
||||
builder: (context, appProvider, child) {
|
||||
return buildVersionInfo(
|
||||
context: context,
|
||||
fullVersion: appProvider.fullVersion,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user