浪漫雅圆(FlymeFont.ttf)脱色处理并添加代码适配

This commit is contained in:
2026-07-14 22:58:37 +08:00
parent adc49fa1a5
commit bb9a3dc3f5
3 changed files with 38 additions and 94 deletions
+19 -62
View File
@@ -38,9 +38,11 @@ class BatteryInfoPanel extends StatelessWidget {
children: [
RichText(
text: TextSpan(
style: const TextStyle(
style: TextStyle(
fontFamily: 'Flyme',
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.red,
),
children: [
const TextSpan(
@@ -50,29 +52,18 @@ class BatteryInfoPanel extends StatelessWidget {
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,
),
),
TextSpan(text: '${maxVolt.toStringAsFixed(3)}V'),
],
),
),
const SizedBox(width: 12),
RichText(
text: TextSpan(
style: const TextStyle(
style: TextStyle(
fontFamily: 'Flyme',
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.blue,
),
children: [
const TextSpan(
@@ -82,20 +73,7 @@ class BatteryInfoPanel extends StatelessWidget {
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,
),
),
TextSpan(text: '${minVolt.toStringAsFixed(3)}V'),
],
),
),
@@ -111,16 +89,18 @@ class BatteryInfoPanel extends StatelessWidget {
_buildInfoItem(
_buildIcon('temperature'),
'温度',
'${batteryTemp.toStringAsFixed(0)}°C',
'${batteryTemp.toStringAsFixed(0)}',
),
const SizedBox(height: 8),
Row(
children: [
RichText(
text: TextSpan(
style: const TextStyle(
style: TextStyle(
fontFamily: 'Flyme',
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.red,
),
children: [
const TextSpan(
@@ -130,29 +110,18 @@ class BatteryInfoPanel extends StatelessWidget {
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,
),
),
TextSpan(text: '${maxTemp.toStringAsFixed(0)}'),
],
),
),
const SizedBox(width: 12),
RichText(
text: TextSpan(
style: const TextStyle(
style: TextStyle(
fontFamily: 'Flyme',
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.blue,
),
children: [
const TextSpan(
@@ -162,20 +131,7 @@ class BatteryInfoPanel extends StatelessWidget {
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,
),
),
TextSpan(text: '${minTemp.toStringAsFixed(0)}'),
],
),
),
@@ -226,9 +182,10 @@ class BatteryInfoPanel extends StatelessWidget {
Text(
value,
style: const TextStyle(
fontFamily: 'Flyme', // 🟢 数字(含单位)用 Flyme
fontFamily: 'Flyme',
fontSize: 16,
fontWeight: FontWeight.w500,
color: Colors.black,
),
),
],