优化部分页面下UI显示问题

This commit is contained in:
2026-07-08 23:42:21 +08:00
parent 23d5c3b341
commit 9066b0f703
3 changed files with 59 additions and 44 deletions
+2 -1
View File
@@ -631,7 +631,8 @@ class _BatteryHealthPageState extends State<BatteryHealthPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>( return AnnotatedRegion<SystemUiOverlayStyle>(
value: const SystemUiOverlayStyle( value: const SystemUiOverlayStyle(
statusBarColor: Colors.white, // 🟢 1.5.0 统一状态栏颜色
statusBarColor: Color.fromRGBO(157, 212, 237, 0.1),
statusBarIconBrightness: Brightness.dark, statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.dark, statusBarBrightness: Brightness.dark,
), ),
+24 -10
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../utils/charge_utils.dart'; import '../utils/charge_utils.dart';
/// 充电详情页 /// 充电详情页
@@ -11,14 +12,14 @@ class ChargeDetailPage extends StatelessWidget {
final int? wiredLevel; final int? wiredLevel;
const ChargeDetailPage({ const ChargeDetailPage({
super.key, Key? key,
required this.chargeType, required this.chargeType,
required this.isWireless, required this.isWireless,
required this.power, required this.power,
required this.volt, required this.volt,
required this.curr, required this.curr,
this.wiredLevel, this.wiredLevel,
}); }) : super(key: key);
String _getProtocolDisplay() { String _getProtocolDisplay() {
if (isWireless) return '无线充电($chargeType'; if (isWireless) return '无线充电($chargeType';
@@ -27,7 +28,6 @@ class ChargeDetailPage extends StatelessWidget {
return chargeType; return chargeType;
} }
/// 🟢 1.5.0 标定档位显示
String _getRequestedDisplay() { String _getRequestedDisplay() {
return ChargeUtils.getDetailRequestedPowerWired( return ChargeUtils.getDetailRequestedPowerWired(
power, power,
@@ -36,18 +36,28 @@ class ChargeDetailPage extends StatelessWidget {
); );
} }
/// 🟢 1.5.0 实际功率显示
String _getActualDisplay() { String _getActualDisplay() {
return ChargeUtils.getDetailActualPowerWired(power, chargeType); return ChargeUtils.getDetailActualPowerWired(power, chargeType);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return AnnotatedRegion<SystemUiOverlayStyle>(
// 🟢 1.5.0 与主界面统一状态栏样式
value: const SystemUiOverlayStyle(
statusBarColor: Color.fromRGBO(157, 212, 237, 0.5),
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.dark,
),
child: Scaffold(
backgroundColor: Colors.white,
appBar: AppBar( appBar: AppBar(
title: const Text('充电详情'), title: const Text('充电详情'),
backgroundColor: Colors.transparent, backgroundColor: Colors.white, // 🟢 与主界面统一
elevation: 0, elevation: 0,
scrolledUnderElevation: 0,
shadowColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
foregroundColor: Colors.black, foregroundColor: Colors.black,
iconTheme: const IconThemeData(color: Colors.black), iconTheme: const IconThemeData(color: Colors.black),
), ),
@@ -59,15 +69,17 @@ class ChargeDetailPage extends StatelessWidget {
_buildDetailRow('协议', _getProtocolDisplay()), _buildDetailRow('协议', _getProtocolDisplay()),
const Divider(), const Divider(),
// 🟢 1.5.0 有线充电:标定档位 + 实际功率 两行 // 有线充电:标定档位 + 实际功率
if (!isWireless) ...[ if (!isWireless) ...[
_buildDetailRow('标定档位', _getRequestedDisplay()), _buildDetailRow('标定档位', _getRequestedDisplay()),
const Divider(), const Divider(),
_buildDetailRow('实际功率', _getActualDisplay()), _buildDetailRow('实际功率', _getActualDisplay()),
const Divider(), const Divider(),
] else ...[ ] else ...[
// 无线充电:保持原样,只显示功率 _buildDetailRow(
_buildDetailRow('功率', ChargeUtils.getDisplayPowerWireless(power)), '功率',
ChargeUtils.getDisplayPowerWireless(power),
),
const Divider(), const Divider(),
], ],
@@ -78,7 +90,8 @@ class ChargeDetailPage extends StatelessWidget {
// 辅助信息 // 辅助信息
if (isWireless) _buildDetailRow('类型', '无线'), if (isWireless) _buildDetailRow('类型', '无线'),
if (!isWireless && wiredLevel == null) _buildDetailRow('档位', '自动'), if (!isWireless && wiredLevel == null)
_buildDetailRow('档位', '自动'),
const Spacer(), const Spacer(),
Center( Center(
@@ -90,6 +103,7 @@ class ChargeDetailPage extends StatelessWidget {
], ],
), ),
), ),
),
); );
} }
+1 -1
View File
@@ -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 # 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 # 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. # 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: environment:
sdk: ^3.9.2 sdk: ^3.9.2