From 49d4127ad91bab7b48dd4f23d0a9ac088ddb8276 Mon Sep 17 00:00:00 2001 From: lxh2875931338 Date: Sat, 4 Jul 2026 12:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=8B=E5=8A=BF=E5=9B=BE=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/battery_health_page.dart | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/pages/battery_health_page.dart b/lib/pages/battery_health_page.dart index aba3007..98f6e5d 100644 --- a/lib/pages/battery_health_page.dart +++ b/lib/pages/battery_health_page.dart @@ -1035,17 +1035,18 @@ class _BatteryHealthPageState extends State crossAxisAlignment: CrossAxisAlignment.end, children: List.generate(percents.length, (index) { double value = percents[index]; - Color barColor; - if (value > 0) { - if (value >= 80) - barColor = kHealthGreen; - else if (value >= 60) - barColor = kHealthYellow; - else - barColor = kHealthOrange; - } else { - barColor = Colors.grey.shade300; - } +Color barColor; +if (value > 0) { + if (value >= 80) { + barColor = kHealthGreen; + } else if (value >= 70) { + barColor = kHealthYellow; + } else { + barColor = Colors.red; // 🟢 小于 70 显示红色 + } +} else { + barColor = Colors.grey.shade300; +} double clampedValue = value.clamp(70.0, 100.0); double heightFactor = (clampedValue - 70.0) / 30.0;