From 4829cd1da259162835758610db1bdcb04ed130b5 Mon Sep 17 00:00:00 2001 From: lxh2875931338 Date: Sun, 11 Oct 2026 16:08:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E8=B0=83=E6=95=B4=EF=BC=8C=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E9=83=A8=E5=88=86=E5=86=97=E4=BD=99=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/CHANGELOG.md | 12 ++++++++++++ lib/main.dart | 5 ++--- lib/pages/about_page.dart | 2 -- lib/pages/battery_health_page.dart | 24 ++++++++++++++++-------- lib/pages/changelog_page.dart | 3 +-- lib/widgets/charge_detail_page.dart | 5 ----- 6 files changed, 31 insertions(+), 20 deletions(-) diff --git a/assets/CHANGELOG.md b/assets/CHANGELOG.md index a2088d0..6fe0d6c 100644 --- a/assets/CHANGELOG.md +++ b/assets/CHANGELOG.md @@ -1,3 +1,15 @@ +## 1.8.0 + +### 新增 +- **夜间模式**:支持浅色 / 深色 / 跟随系统三种模式,可在右上角菜单切换 +- **主题系统重构**:统一颜色抽象,所有界面颜色由主题管理 + +### 优化 +- 深色主题下潘通色系重新调色,保证对比度 +- AppBar 与内容区背景统一,消除浅色模式下的分界线 + +---- + ## [1.7.1] - 2026-09-16 ### 新增 diff --git a/lib/main.dart b/lib/main.dart index b75cad5..8b65f61 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -49,10 +49,9 @@ class MyApp extends StatelessWidget { appBarTheme: AppBarTheme( backgroundColor: colors.background, // ← 关键:和 Scaffold 一致 foregroundColor: colors.textPrimary, - surfaceTintColor: Colors.transparent, // ← 关掉 M3 的滑动变色 + // ← 关掉 M3 的滑动变色 elevation: 0, - scrolledUnderElevation: 0, - shadowColor: Colors.transparent, + iconTheme: IconThemeData(color: colors.textPrimary), ), diff --git a/lib/pages/about_page.dart b/lib/pages/about_page.dart index dd11d12..956859f 100644 --- a/lib/pages/about_page.dart +++ b/lib/pages/about_page.dart @@ -21,8 +21,6 @@ class AboutPage extends StatelessWidget { ), backgroundColor: c.background, elevation: 0, - foregroundColor: c.textPrimary, - iconTheme: IconThemeData(color: c.textPrimary), ), body: Center( child: Padding( diff --git a/lib/pages/battery_health_page.dart b/lib/pages/battery_health_page.dart index 7e36796..bae9f5f 100644 --- a/lib/pages/battery_health_page.dart +++ b/lib/pages/battery_health_page.dart @@ -707,9 +707,7 @@ class _BatteryHealthPageState extends State { appBar: AppBar( // backgroundColor: Colors.white, elevation: 0, - scrolledUnderElevation: 0, - shadowColor: Colors.transparent, - surfaceTintColor: Colors.transparent, + title: Text( '电池健康度', style: TextStyle( @@ -852,19 +850,29 @@ class _BatteryHealthPageState extends State { ), ], ) - : const Center( + : Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon(Icons.battery_unknown, size: 64, color: Colors.grey), - SizedBox(height: 16), + Icon( + Icons.battery_unknown, + size: 64, + color: context.colors.textTertiary, + ), + const SizedBox(height: 16), Text( '暂无数据', - style: TextStyle(fontSize: 18, color: Colors.grey), + style: TextStyle( + fontSize: 18, + color: context.colors.textTertiary, + ), ), Text( '点击右上角刷新尝试', - style: TextStyle(fontSize: 14, color: Colors.grey), + style: TextStyle( + fontSize: 14, + color: context.colors.textTertiary, + ), ), ], ), diff --git a/lib/pages/changelog_page.dart b/lib/pages/changelog_page.dart index db2176f..24c7812 100644 --- a/lib/pages/changelog_page.dart +++ b/lib/pages/changelog_page.dart @@ -158,8 +158,7 @@ class _ChangelogPageState extends State ), ), elevation: 0, - foregroundColor: c.textPrimary, - iconTheme: IconThemeData(color: c.textPrimary), + bottom: PreferredSize( preferredSize: const Size.fromHeight(2.0), child: LinearProgressIndicator( diff --git a/lib/widgets/charge_detail_page.dart b/lib/widgets/charge_detail_page.dart index af14b59..77f7ed1 100644 --- a/lib/widgets/charge_detail_page.dart +++ b/lib/widgets/charge_detail_page.dart @@ -56,11 +56,6 @@ class ChargeDetailPage extends StatelessWidget { title: const Text('充电详情'), backgroundColor: c.background, elevation: 0, - scrolledUnderElevation: 0, - shadowColor: Colors.transparent, - surfaceTintColor: Colors.transparent, - foregroundColor: c.textPrimary, - iconTheme: IconThemeData(color: c.textPrimary), ), body: Padding( padding: const EdgeInsets.all(20.0),