From 64e1a9f910ea7da54f052d992868a0c03694e6b5 Mon Sep 17 00:00:00 2001 From: lxh2875931338 Date: Sat, 4 Jul 2026 12:30:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B9=E9=87=8F=E7=99=BE=E5=88=86=E6=AF=94?= =?UTF-8?q?=E5=8F=98=E8=89=B2=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/battery_health_page.dart | 47 +++++++++++++++--------------- pubspec.yaml | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/lib/pages/battery_health_page.dart b/lib/pages/battery_health_page.dart index 72aa9ed..290b312 100644 --- a/lib/pages/battery_health_page.dart +++ b/lib/pages/battery_health_page.dart @@ -789,30 +789,31 @@ class _BatteryHealthPageState extends State Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, - children: [ - Text( - healthPercent.toStringAsFixed(1), - style: const TextStyle( - fontSize: 40, - fontWeight: FontWeight.w500, - height: 1.0, - ), - ), - const SizedBox(width: 2), - Text( - '%', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w300, - height: 1.0, - color: Colors.grey.shade600, - ), - ), - ], + Row( + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Text( + healthPercent.toStringAsFixed(1), + style: TextStyle( + fontSize: 40, + fontWeight: FontWeight.w500, + height: 1.0, + color: healthPercent < 70 ? Colors.red : Colors.black, // 🟢 动态颜色 ), + ), + const SizedBox(width: 2), + Text( + '%', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w300, + height: 1.0, + color: healthPercent < 70 ? Colors.red : Colors.grey.shade600, // 🟢 动态颜色 + ), + ), + ], + ), const Spacer(), Column( crossAxisAlignment: CrossAxisAlignment.end, diff --git a/pubspec.yaml b/pubspec.yaml index 91656f7..58e31ba 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.2.0-dev.3 +version: 1.3.0 environment: sdk: ^3.9.2