diff --git a/lib/pages/battery_health_page.dart b/lib/pages/battery_health_page.dart index 2e9196a..fc6b455 100644 --- a/lib/pages/battery_health_page.dart +++ b/lib/pages/battery_health_page.dart @@ -631,7 +631,8 @@ class _BatteryHealthPageState extends State Widget build(BuildContext context) { return AnnotatedRegion( value: const SystemUiOverlayStyle( - statusBarColor: Colors.white, + // 🟢 1.5.0 统一状态栏颜色 + statusBarColor: Color.fromRGBO(157, 212, 237, 0.1), statusBarIconBrightness: Brightness.dark, statusBarBrightness: Brightness.dark, ), diff --git a/lib/widgets/charge_detail_page.dart b/lib/widgets/charge_detail_page.dart index 7420535..c86ac1b 100644 --- a/lib/widgets/charge_detail_page.dart +++ b/lib/widgets/charge_detail_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import '../utils/charge_utils.dart'; /// 充电详情页 @@ -11,14 +12,14 @@ class ChargeDetailPage extends StatelessWidget { final int? wiredLevel; const ChargeDetailPage({ - super.key, + Key? key, required this.chargeType, required this.isWireless, required this.power, required this.volt, required this.curr, this.wiredLevel, - }); + }) : super(key: key); String _getProtocolDisplay() { if (isWireless) return '无线充电($chargeType)'; @@ -27,7 +28,6 @@ class ChargeDetailPage extends StatelessWidget { return chargeType; } - /// 🟢 1.5.0 标定档位显示 String _getRequestedDisplay() { return ChargeUtils.getDetailRequestedPowerWired( power, @@ -36,58 +36,72 @@ class ChargeDetailPage extends StatelessWidget { ); } - /// 🟢 1.5.0 实际功率显示 String _getActualDisplay() { return ChargeUtils.getDetailActualPowerWired(power, chargeType); } @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('充电详情'), - backgroundColor: Colors.transparent, - elevation: 0, - foregroundColor: Colors.black, - iconTheme: const IconThemeData(color: Colors.black), + return AnnotatedRegion( + // 🟢 1.5.0 与主界面统一状态栏样式 + value: const SystemUiOverlayStyle( + statusBarColor: Color.fromRGBO(157, 212, 237, 0.5), + statusBarIconBrightness: Brightness.dark, + statusBarBrightness: Brightness.dark, ), - body: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - _buildDetailRow('协议', _getProtocolDisplay()), - const Divider(), - - // 🟢 1.5.0 有线充电:标定档位 + 实际功率 两行 - if (!isWireless) ...[ - _buildDetailRow('标定档位', _getRequestedDisplay()), + child: Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + title: const Text('充电详情'), + backgroundColor: Colors.white, // 🟢 与主界面统一 + elevation: 0, + scrolledUnderElevation: 0, + shadowColor: Colors.transparent, + surfaceTintColor: Colors.transparent, + foregroundColor: Colors.black, + iconTheme: const IconThemeData(color: Colors.black), + ), + body: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildDetailRow('协议', _getProtocolDisplay()), const Divider(), - _buildDetailRow('实际功率', _getActualDisplay()), + + // 有线充电:标定档位 + 实际功率 + if (!isWireless) ...[ + _buildDetailRow('标定档位', _getRequestedDisplay()), + const Divider(), + _buildDetailRow('实际功率', _getActualDisplay()), + const Divider(), + ] else ...[ + _buildDetailRow( + '功率', + ChargeUtils.getDisplayPowerWireless(power), + ), + const Divider(), + ], + + _buildDetailRow('电压', '${volt.toStringAsFixed(2)}V'), const Divider(), - ] else ...[ - // 无线充电:保持原样,只显示功率 - _buildDetailRow('功率', ChargeUtils.getDisplayPowerWireless(power)), + _buildDetailRow('电流', '${curr.toStringAsFixed(2)}A'), const Divider(), - ], - _buildDetailRow('电压', '${volt.toStringAsFixed(2)}V'), - const Divider(), - _buildDetailRow('电流', '${curr.toStringAsFixed(2)}A'), - const Divider(), + // 辅助信息 + if (isWireless) _buildDetailRow('类型', '无线'), + if (!isWireless && wiredLevel == null) + _buildDetailRow('档位', '自动'), - // 辅助信息 - if (isWireless) _buildDetailRow('类型', '无线'), - if (!isWireless && wiredLevel == null) _buildDetailRow('档位', '自动'), - - const Spacer(), - Center( - child: Text( - '数据来自 BMS 实时日志', - style: TextStyle(fontSize: 12, color: Colors.grey.shade500), + const Spacer(), + Center( + child: Text( + '数据来自 BMS 实时日志', + style: TextStyle(fontSize: 12, color: Colors.grey.shade500), + ), ), - ), - ], + ], + ), ), ), ); diff --git a/pubspec.yaml b/pubspec.yaml index 617dc48..f754e59 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.5.0-dev.3 +version: 1.5.0 environment: sdk: ^3.9.2