更新一个字体
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
/// 电池信息面板(电压 + 温度 + 极值)
|
||||
class BatteryInfoPanel extends StatelessWidget {
|
||||
final double batteryVolt;
|
||||
final double batteryTemp;
|
||||
@@ -37,21 +36,67 @@ class BatteryInfoPanel extends StatelessWidget {
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'↑ ${maxVolt.toStringAsFixed(3)}V',
|
||||
style: const TextStyle(
|
||||
color: Colors.red,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
children: [
|
||||
const TextSpan(
|
||||
text: '↑ ',
|
||||
style: TextStyle(
|
||||
fontFamily: 'HarmonyOS_Sans_SC',
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: maxVolt.toStringAsFixed(3),
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Flyme', // 🟢 数字用 Flyme
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
const TextSpan(
|
||||
text: 'V',
|
||||
style: TextStyle(
|
||||
fontFamily: 'HarmonyOS_Sans_SC',
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
'↓ ${minVolt.toStringAsFixed(3)}V',
|
||||
style: const TextStyle(
|
||||
color: Colors.blue,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
children: [
|
||||
const TextSpan(
|
||||
text: '↓ ',
|
||||
style: TextStyle(
|
||||
fontFamily: 'HarmonyOS_Sans_SC',
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: minVolt.toStringAsFixed(3),
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Flyme', // 🟢 数字用 Flyme
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
const TextSpan(
|
||||
text: 'V',
|
||||
style: TextStyle(
|
||||
fontFamily: 'HarmonyOS_Sans_SC',
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -71,21 +116,67 @@ class BatteryInfoPanel extends StatelessWidget {
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'↑ ${maxTemp.toStringAsFixed(0)}°C',
|
||||
style: const TextStyle(
|
||||
color: Colors.red,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
children: [
|
||||
const TextSpan(
|
||||
text: '↑ ',
|
||||
style: TextStyle(
|
||||
fontFamily: 'HarmonyOS_Sans_SC',
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: maxTemp.toStringAsFixed(0),
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Flyme', // 🟢 数字用 Flyme
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
const TextSpan(
|
||||
text: '°C',
|
||||
style: TextStyle(
|
||||
fontFamily: 'HarmonyOS_Sans_SC',
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
'↓ ${minTemp.toStringAsFixed(0)}°C',
|
||||
style: const TextStyle(
|
||||
color: Colors.blue,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
children: [
|
||||
const TextSpan(
|
||||
text: '↓ ',
|
||||
style: TextStyle(
|
||||
fontFamily: 'HarmonyOS_Sans_SC',
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: minTemp.toStringAsFixed(0),
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Flyme', // 🟢 数字用 Flyme
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
const TextSpan(
|
||||
text: '°C',
|
||||
style: TextStyle(
|
||||
fontFamily: 'HarmonyOS_Sans_SC',
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -123,11 +214,22 @@ class BatteryInfoPanel extends StatelessWidget {
|
||||
children: [
|
||||
icon,
|
||||
const SizedBox(width: 6),
|
||||
Text(label, style: const TextStyle(fontSize: 14, color: Colors.grey)),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'HarmonyOS_Sans_SC',
|
||||
fontSize: 14,
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
value,
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Flyme', // 🟢 数字(含单位)用 Flyme
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user