2 Commits

Author SHA1 Message Date
lxh2875931338 17c728565c 确认变色逻辑 2026-07-04 12:32:42 +08:00
lxh2875931338 49d4127ad9 趋势图逻辑改动 2026-07-04 12:25:46 +08:00
+28 -24
View File
@@ -789,31 +789,35 @@ class _BatteryHealthPageState extends State<BatteryHealthPage>
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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, // 🟢 动态颜色
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 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,