更新法语语言包

This commit is contained in:
wyf
2026-01-31 14:43:47 +08:00
parent 2aedbb3d74
commit 97ffc1220d
48 changed files with 1608 additions and 1837 deletions

View File

@@ -40,33 +40,35 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
if (dataPoints.isEmpty) {
return (8.0, 20.0);
}
// 过滤掉无效数据点(值为-1的
final validPoints = dataPoints.where((point) => point.value >= 0).toList();
if (validPoints.isEmpty) {
return (8.0, 20.0);
}
// 找出数据中的实际最小值和最大值
double dataMin = validPoints.map((point) => point.value).reduce((a, b) => a < b ? a : b);
double dataMax = validPoints.map((point) => point.value).reduce((a, b) => a > b ? a : b);
double dataMin =
validPoints.map((point) => point.value).reduce((a, b) => a < b ? a : b);
double dataMax =
validPoints.map((point) => point.value).reduce((a, b) => a > b ? a : b);
// 设置默认范围
double yMin = 8.0;
double yMax = 20.0;
// 如果数据范围超出了默认范围,则调整
if (dataMin < yMin) {
// 最小值为0不能为负数且向下浮动2
yMin = (dataMin - 2).clamp(0.0, double.infinity);
}
if (dataMax > yMax) {
// 向上浮动2
yMax = dataMax + 2;
}
return (yMin, yMax);
}
@@ -102,7 +104,7 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
List<Map<String, dynamic>> brs =
(widget.sleepReport['brs'] as List).cast<Map<String, dynamic>>();
Map<String, dynamic>? avgBreath = brs.firstWhere(
(element) => element['id'] == 307,
orElse: () => {},
@@ -139,8 +141,8 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
width: double.infinity,
decoration: BoxDecoration(
color: themeController.currentColor.sc5,
borderRadius: BorderRadius.circular(
AppConstants().normal_container_radius),
borderRadius:
BorderRadius.circular(AppConstants().normal_container_radius),
),
child: Padding(
padding:
@@ -205,8 +207,8 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
}
},
child: Container(
padding: EdgeInsetsDirectional.fromSTEB(
0, 0.rpx, 0.rpx, 0),
padding:
EdgeInsetsDirectional.fromSTEB(0, 0.rpx, 0.rpx, 0),
width: 28.rpx,
height: 28.rpx,
child: SvgPicture.asset(
@@ -242,8 +244,7 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
Text(
'正常范围'.tr + "${range}",
style: TextStyle(
fontSize:
AppConstants().smaller_text_fontSize,
fontSize: AppConstants().smaller_text_fontSize,
color: themeController.currentColor.sc3,
),
),
@@ -264,150 +265,162 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
)),
),
),
// Padding(
// padding:
// EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: [
// Column(
// children: [
// Text(
// "${avgBreath['name']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize: AppConstants().normal_text_fontSize),
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Text(
// "${avgBreath['value']}",
// style: TextStyle(
// color: themeController.currentColor.sc2,
// fontSize:
// AppConstants().normal_text_fontSize),
// ),
// Text(
// "${avgBreath['unit']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize: AppConstants().small_text_fontSize),
// ),
// ].divide(SizedBox(
// width: 6.rpx,
// )),
// ),
// ],
// ),
// Column(
// children: [
// Text(
// "${baseBreath['name']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize: AppConstants().normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Text(
// "${baseBreath['value']}",
// style: TextStyle(
// color: themeController.currentColor.sc2,
// fontSize:
// AppConstants().normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Text(
// "${baseBreath['unit']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize: AppConstants().small_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// ].divide(SizedBox(
// width: 6.rpx,
// )),
// ),
// ],
// ),
// Column(
// children: [
// Text(
// "${minBreath['name']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize: AppConstants().normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Text(
// "${minBreath['value']}",
// style: TextStyle(
// color: themeController.currentColor.sc2,
// fontSize:
// AppConstants().normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Text(
// "${minBreath['unit']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize: AppConstants().small_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// ].divide(SizedBox(
// width: 6.rpx,
// )),
// ),
// ],
// ),
// Column(
// children: [
// Text(
// "${maxBreath['name']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize: AppConstants().normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Text(
// "${maxBreath['value']}",
// style: TextStyle(
// color: themeController.currentColor.sc2,
// fontSize:
// AppConstants().normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Text(
// "${maxBreath['unit']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize: AppConstants().small_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// ].divide(SizedBox(
// width: 6.rpx,
// )),
// ),
// ],
// ),
// ],
// ),
// ),
Padding(
padding:
EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
children: [
Text(
"${avgBreath['name']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().normal_text_fontSize),
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"${avgBreath['value']}",
style: TextStyle(
color: themeController.currentColor.sc2,
fontSize:
AppConstants().normal_text_fontSize),
),
Text(
"${avgBreath['unit']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().small_text_fontSize),
),
].divide(SizedBox(
width: 6.rpx,
)),
),
],
),
Column(
children: [
Text(
"${baseBreath['name']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"${baseBreath['value']}",
style: TextStyle(
color: themeController.currentColor.sc2,
fontSize:
AppConstants().normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Text(
"${baseBreath['unit']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().small_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
].divide(SizedBox(
width: 6.rpx,
)),
),
],
),
Column(
children: [
Text(
"${minBreath['name']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"${minBreath['value']}",
style: TextStyle(
color: themeController.currentColor.sc2,
fontSize:
AppConstants().normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Text(
"${minBreath['unit']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().small_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
].divide(SizedBox(
width: 6.rpx,
)),
),
],
),
Column(
children: [
Text(
"${maxBreath['name']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"${maxBreath['value']}",
style: TextStyle(
color: themeController.currentColor.sc2,
fontSize:
AppConstants().normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Text(
"${maxBreath['unit']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().small_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
].divide(SizedBox(
width: 6.rpx,
)),
),
],
),
_buildBreathItem(avgBreath),
_buildBreathItem(baseBreath),
_buildBreathItem(minBreath),
_buildBreathItem(maxBreath),
],
),
),
@@ -420,4 +433,70 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
return Container();
}
}
}
Widget _buildBreathItem(Map<String, dynamic> data) {
return Expanded(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 4.rpx, vertical: 4.rpx),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// 名称 - 最多2行
Flexible(
child: Text(
"${data['name']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().normal_text_fontSize,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
SizedBox(height: 4.rpx),
// 值 + 单位 - 最多2行
Flexible(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
fit: FlexFit.loose,
child: Text(
"${data['value']}",
style: TextStyle(
color: themeController.currentColor.sc2,
fontSize: AppConstants().normal_text_fontSize,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
SizedBox(width: 4.rpx),
Flexible(
fit: FlexFit.loose,
child: Text(
"${data['unit']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().small_text_fontSize,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
],
),
),
],
),
),
);
}
}

View File

@@ -61,11 +61,15 @@ class _DiseasePercentsWidgetState extends State<DiseasePercentsWidget> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"慢性病风险指数".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().title_text_fontSize),
Expanded(
child: Text(
"慢性病风险指数".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().title_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
ClickableContainer(
backgroundColor: Colors.transparent,
@@ -76,7 +80,8 @@ class _DiseasePercentsWidgetState extends State<DiseasePercentsWidget> {
onTap: () {
// 你的点击逻辑
if (AppConstants().ent_type == APPPackageType.MHT.code) {
if (AppConstants().ent_type ==
APPPackageType.MHT.code) {
showTipDialog(
context,
Container(

View File

@@ -63,11 +63,15 @@ class _HeartChangeWidgetState extends State<HeartChangeWidget> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"心率变异性HRV".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().title_text_fontSize),
Expanded(
child: Text(
"心率变异性HRV".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().title_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
ClickableContainer(
backgroundColor: Colors.transparent,

View File

@@ -82,7 +82,6 @@ class _HeartHealthWidgetState extends State<HeartHealthWidget> {
context,
Container(
child: Text(
// "心理健康评估介绍".tr,
"心率健康评估主要通过用户睡眠报告中的时间点、体征数据及HRV数据等信息来判断其心理健康水平、疲劳程度。"
.tr,
style: TextStyle(
@@ -140,11 +139,17 @@ class _HeartHealthWidgetState extends State<HeartHealthWidget> {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FatigueCircleIndicator(
data: showLabel[0],
Flexible(
flex: 1,
child: FatigueCircleIndicator(
data: showLabel[0],
),
),
FatigueCircleIndicator(
data: showLabel[1],
Flexible(
flex: 1,
child: FatigueCircleIndicator(
data: showLabel[1],
),
),
].divide(SizedBox(
width: 110.rpx,

View File

@@ -82,11 +82,15 @@ class _HeartPointWidgetState extends State<HeartPointWidget> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"心率散点图".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().title_text_fontSize),
Expanded(
child: Text(
"心率散点图".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().title_text_fontSize),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
),
ClickableContainer(
backgroundColor: Colors.transparent,

View File

@@ -249,158 +249,170 @@ class _HeartRateStandardWidgetState extends State<HeartRateStandardWidget> {
// actYMax: max.toDouble(),
),
),
// Padding(
// padding: EdgeInsetsDirectional.fromSTEB(
// 30.rpx, 0.rpx, 0.rpx, 0.rpx),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: [
// Column(
// children: [
// Text(
// "${avgHeartRate['name']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize:
// AppConstants().normal_text_fontSize),
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Text(
// "${avgHeartRate['value']}",
// style: TextStyle(
// color: themeController.currentColor.sc2,
// fontSize: AppConstants()
// .normal_text_fontSize),
// ),
// Text(
// "${avgHeartRate['unit']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize:
// AppConstants().small_text_fontSize),
// ),
// ].divide(SizedBox(
// width: 6.rpx,
// )),
// ),
// ],
// ),
// Column(
// children: [
// Text(
// "${baseHeartRate['name']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize:
// AppConstants().normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Text(
// "${baseHeartRate['value']}",
// style: TextStyle(
// color: themeController.currentColor.sc2,
// fontSize: AppConstants()
// .normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Text(
// "${baseHeartRate['unit']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize:
// AppConstants().small_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// ].divide(SizedBox(
// width: 6.rpx,
// )),
// ),
// ],
// ),
// Column(
// children: [
// Text(
// "${minHeartRate['name']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize:
// AppConstants().normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Text(
// "${minHeartRate['value']}",
// style: TextStyle(
// color: themeController.currentColor.sc2,
// fontSize: AppConstants()
// .normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Text(
// "${minHeartRate['unit']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize:
// AppConstants().small_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// ].divide(SizedBox(
// width: 6.rpx,
// )),
// ),
// ],
// ),
// Column(
// children: [
// Text(
// "${maxHeartRate['name']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize:
// AppConstants().normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Text(
// "${maxHeartRate['value']}",
// style: TextStyle(
// color: themeController.currentColor.sc2,
// fontSize: AppConstants()
// .normal_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// Text(
// "${maxHeartRate['unit']}",
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize:
// AppConstants().small_text_fontSize),
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// ),
// ].divide(SizedBox(
// width: 6.rpx,
// )),
// ),
// ],
// ),
// ],
// ),
// ),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
30.rpx, 0.rpx, 0.rpx, 0.rpx),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
children: [
Text(
"${avgHeartRate['name']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize:
AppConstants().normal_text_fontSize),
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"${avgHeartRate['value']}",
style: TextStyle(
color: themeController.currentColor.sc2,
fontSize: AppConstants()
.normal_text_fontSize),
),
Text(
"${avgHeartRate['unit']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize:
AppConstants().small_text_fontSize),
),
].divide(SizedBox(
width: 6.rpx,
)),
),
],
),
Column(
children: [
Text(
"${baseHeartRate['name']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize:
AppConstants().normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"${baseHeartRate['value']}",
style: TextStyle(
color: themeController.currentColor.sc2,
fontSize: AppConstants()
.normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Text(
"${baseHeartRate['unit']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize:
AppConstants().small_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
].divide(SizedBox(
width: 6.rpx,
)),
),
],
),
Column(
children: [
Text(
"${minHeartRate['name']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize:
AppConstants().normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"${minHeartRate['value']}",
style: TextStyle(
color: themeController.currentColor.sc2,
fontSize: AppConstants()
.normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Text(
"${minHeartRate['unit']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize:
AppConstants().small_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
].divide(SizedBox(
width: 6.rpx,
)),
),
],
),
Column(
children: [
Text(
"${maxHeartRate['name']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize:
AppConstants().normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"${maxHeartRate['value']}",
style: TextStyle(
color: themeController.currentColor.sc2,
fontSize: AppConstants()
.normal_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Text(
"${maxHeartRate['unit']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize:
AppConstants().small_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
].divide(SizedBox(
width: 6.rpx,
)),
),
],
),
_buildHeartRateItem(avgHeartRate),
_buildHeartRateItem(baseHeartRate),
_buildHeartRateItem(minHeartRate),
_buildHeartRateItem(maxHeartRate),
],
),
),
@@ -418,4 +430,70 @@ class _HeartRateStandardWidgetState extends State<HeartRateStandardWidget> {
return Container();
}
}
Widget _buildHeartRateItem(Map<String, dynamic> data) {
return Expanded(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 4.rpx, vertical: 4.rpx),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// 名称 - 最多2行
Flexible(
child: Text(
"${data['name']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().normal_text_fontSize,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
SizedBox(height: 4.rpx),
// 值 + 单位 - 最多2行
Flexible(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
fit: FlexFit.loose,
child: Text(
"${data['value']}",
style: TextStyle(
color: themeController.currentColor.sc2,
fontSize: AppConstants().normal_text_fontSize,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
SizedBox(width: 6.rpx),
Flexible(
fit: FlexFit.loose,
child: Text(
"${data['unit']}",
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().small_text_fontSize,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
],
),
),
],
),
),
);
}
}

View File

@@ -97,7 +97,6 @@ class _SkinPercentWidgetState extends State<SkinPercentWidget> {
context,
Container(
child: Text(
// "心理健康评估介绍".tr,
"皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。"
.tr,
style: TextStyle(

View File

@@ -37,11 +37,15 @@ class SleepChartContainer extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
Expanded(
child: Text(
title,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
ClickableContainer(

View File

@@ -158,6 +158,8 @@ class _SleepScoreWidgetState extends State<SleepScoreWidget> {
fontSize:
AppConstants().normal_text_fontSize,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
Text(

View File

@@ -1,380 +1,3 @@
// import 'package:EasyDartModule/EasyDartModule.dart' as es;
// import 'package:ef/ef.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_svg/svg.dart';
// import 'package:vbvs_app/common/color/appConstants.dart';
// import 'package:vbvs_app/common/util/FitTool.dart';
// import 'package:vbvs_app/common/util/MyUtils.dart';
// import 'package:vbvs_app/component/tool/ClickableContainer.dart';
// import 'package:vbvs_app/enum/APPPackageType.dart';
// import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
// import 'package:vbvs_app/pages/sleep_report/chart/SnoreChart.dart';
// class SnoreViewWidgetWidget extends StatefulWidget {
// var sleepReport;
// SnoreViewWidgetWidget({super.key, required this.sleepReport});
// @override
// State<SnoreViewWidgetWidget> createState() => _SnoreViewWidgetWidgetState();
// }
// class _SnoreViewWidgetWidgetState extends State<SnoreViewWidgetWidget> {
// @override
// void setState(VoidCallback callback) {
// super.setState(callback);
// }
// @override
// void initState() {
// super.initState();
// }
// @override
// void dispose() {
// super.dispose();
// }
// @override
// Widget build(BuildContext context) {
// try {
// if (widget.sleepReport == null ||
// widget.sleepReport is! Map ||
// widget.sleepReport.isEmpty) {
// return Container();
// }
// // if (APPPackageType.TH.code == AppConstants().ent_type) {
// // return Container();
// // }
// double maxY = 250;
// var startTime = widget.sleepReport['startTime'];
// var endTime = widget.sleepReport['endTime'];
// List snoreValues = [];
// List type = widget.sleepReport['ssp']['type'];
// List lightSnore = widget.sleepReport['ssp']['data'][0];
// List heavySnore = widget.sleepReport['ssp']['data'][1];
// // lightSnore = [
// // ...lightSnore,
// // {
// // 'st': widget.sleepReport['startTime'] + 2 * 60 * 60 * 1000, // 开始后2小时
// // 'et': widget.sleepReport['startTime'] + 2 * 60 * 65 * 1000, // 持续5分钟
// // 'value': 25,
// // },
// // {
// // 'st': widget.sleepReport['startTime'] + 4 * 60 * 60 * 1000, // 开始后4小时
// // 'et': widget.sleepReport['startTime'] + 4 * 60 * 68 * 1000, // 持续8分钟
// // 'value': 18,
// // }
// // ];
// // // 添加模拟数据到重度打鼾列表
// // heavySnore = [
// // ...heavySnore,
// // {
// // 'st': widget.sleepReport['startTime'] + 3 * 60 * 60 * 1000, // 开始后3小时
// // 'et': widget.sleepReport['startTime'] + 3 * 60 * 62 * 1000, // 持续2分钟
// // 'value': 68,
// // },
// // {
// // 'st': widget.sleepReport['startTime'] + 5 * 60 * 60 * 1000, // 开始后5小时
// // 'et': widget.sleepReport['startTime'] + 5 * 60 * 64 * 1000, // 持续4分钟
// // 'value': 72,
// // }
// // ];
// List<Map> processedLightSnore = lightSnore.map((item) {
// return {
// ...item,
// 'id': type[0]['id'],
// 'name': type[0]['name'],
// 'color': type[0]['color'],
// };
// }).toList();
// List<Map> processedHeavySnore = heavySnore.map((item) {
// return {
// ...item,
// 'id': type[1]['id'],
// 'name': type[1]['name'],
// 'color': type[1]['color'],
// };
// }).toList();
// snoreValues = [...processedLightSnore, ...processedHeavySnore];
// snoreValues.sort((a, b) => a['st'].compareTo(b['st']));
// print(snoreValues);
// List<BarData> barDataList = snoreValues.map<BarData>((item) {
// return BarData(
// st: item['st'],
// et: item['et'],
// value: (item['value'] as num).toDouble() > maxY
// ? maxY + 3
// : (item['value'] as num).toDouble(),
// id: item['id'],
// name: item['name'],
// color: (item['color'] == null || item['color'].isEmpty)
// ? (item['id'] == 1 ? Colors.green : Colors.red)
// : stringToColor(item['color']),
// );
// }).toList();
// // List<Map<String, dynamic>> data =
// // (widget.sleepReport['ssp'] as List).cast<Map<String, dynamic>>();
// // List<Map<String, dynamic>> showLabel = convertToShowLabel(data);
// return Container(
// width: double.infinity,
// decoration: BoxDecoration(
// color: themeController.currentColor.sc5,
// borderRadius: BorderRadius.circular(
// AppConstants().normal_container_radius), // 你可以按需调整圆角半径
// ),
// child: Padding(
// padding:
// EdgeInsetsDirectional.fromSTEB(26.rpx, 29.rpx, 26.rpx, 0.rpx),
// child: Column(
// mainAxisSize: MainAxisSize.max,
// children: [
// Container(
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text(
// "打鼾监测".tr,
// style: TextStyle(
// color: themeController.currentColor.sc3,
// fontSize: AppConstants().title_text_fontSize),
// ),
// ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: Colors.white, // 或设置为你需要的水波纹颜色
// padding: EdgeInsetsDirectional.fromSTEB(
// 14.rpx, 10.rpx, 14.rpx, 10.rpx), //
// borderRadius: 0.rpx, // 圆形点击区域
// onTap: () {
// if (AppConstants().ent_type ==
// APPPackageType.MHT.code) {
// showTipDialog(
// context,
// Container(
// child: Text(
// // "打鼾监测介绍。",
// "打鼾监测是指用户在睡眠过程中打鼾频次的图表说明。".tr,
// style: TextStyle(
// fontSize: 26.rpx,
// color: Colors.black,
// ),
// ),
// ),
// backgroundColor: Color(0xFFFFFFFF),
// colors: [
// Color(0XFF1592AA),
// Color(0xFF0C83A7),
// Color(0xFF006FA3)
// ],
// );
// } else {
// showTipDialog(
// context,
// Container(
// child: Text(
// "打鼾监测是指用户在睡眠过程中打鼾频次的图表说明。".tr,
// style: TextStyle(
// fontSize: 26.rpx,
// color: themeController.currentColor.sc3,
// ),
// ),
// ),
// backgroundColor: themeController.currentColor.sc17,
// colors: AppConstants().thNormalButton,
// );
// }
// },
// child: Container(
// padding: EdgeInsetsDirectional.fromSTEB(
// 0, 0.rpx, 0.rpx, 0), // 外部 padding 移到内部
// width: 28.rpx,
// height: 28.rpx,
// child: SvgPicture.asset(
// 'assets/img/icon/explain.svg',
// fit: BoxFit.cover,
// color: themeController.currentColor.sc4,
// ),
// ),
// ),
// ],
// ),
// ),
// SizedBox(
// height: 32.rpx,
// ),
// Row(
// children: [
// Text(
// "次".tr,
// style: TextStyle(
// color: stringToColor("#FFFFFF"), fontSize: 18.rpx),
// ),
// ],
// ),
// Padding(
// padding: EdgeInsetsDirectional.fromSTEB(
// 0.rpx, 40.rpx, 20.rpx, 0.rpx),
// // child: LineChartByRange(
// // showLabel: showLabel,
// // startTime: startTime,
// // endTime: endTime,
// // ),
// child: BarChartWidget(
// data: barDataList,
// startTime: startTime,
// endTime: endTime,
// maxYValue: maxY, // 最大值可自定义
// yStepCount: 3, // 分4段0, 5, 10, 15, 20
// ),
// ),
// Padding(
// padding:
// EdgeInsetsDirectional.fromSTEB(0.rpx, 52.rpx, 0.rpx, 0.rpx),
// child: Container(
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: [
// Column(
// crossAxisAlignment: CrossAxisAlignment.center, // 左对齐
// children: [
// Row(
// children: [
// // 小圆球
// Container(
// width: 14.rpx,
// height: 14.rpx,
// decoration: BoxDecoration(
// color: (type[0]?['color'] == null ||
// type[0]?['color'].isEmpty)
// ? Colors.green
// : stringToColor(
// "${type[0]['color']}"), // 你想要的颜色
// shape: BoxShape.circle,
// ),
// ),
// SizedBox(width: 12.rpx), // 小圆球和文字间距
// Text(
// '${type[0]?['name']}',
// style: TextStyle(
// fontSize:
// AppConstants().normal_text_fontSize,
// color: themeController.currentColor.sc3),
// ),
// ],
// ),
// SizedBox(height: 16.rpx), // 两行文字间距
// Text(
// '${(type[0]?['value'] == null || type[0]['value'].toString().isEmpty) ? '未知数据'.tr : '${type[0]?['value']}${(type[0]?['unit'] == null || type[0]['unit'].toString().isEmpty) ? '' : type[0]?['unit']}'}',
// style: TextStyle(
// fontSize: AppConstants().small_text_fontSize,
// color: themeController.currentColor.sc4),
// ),
// ],
// ),
// Column(
// crossAxisAlignment: CrossAxisAlignment.center, // 左对齐
// children: [
// Row(
// children: [
// // 小圆球
// Container(
// width: 14.rpx,
// height: 14.rpx,
// decoration: BoxDecoration(
// color: (type[1]?['color'] == null ||
// type[1]?['color'].isEmpty)
// ? Colors.red
// : stringToColor(
// "${type[1]['color']}"), // 你想要的颜色
// shape: BoxShape.circle,
// ),
// ),
// SizedBox(width: 12.rpx), // 小圆球和文字间距
// Text(
// '${type[1]?['name']}',
// style: TextStyle(
// fontSize:
// AppConstants().normal_text_fontSize,
// color: themeController.currentColor.sc3),
// ),
// ],
// ),
// SizedBox(height: 16.rpx), // 两行文字间距
// Text(
// '${(type[1]?['value'] == null || type[1]['value'].toString().isEmpty) ? '未知数据'.tr : '${type[1]?['value']}${(type[1]?['unit'] == null || type[1]['unit'].toString().isEmpty) ? '' : type[1]?['unit']}'}',
// style: TextStyle(
// fontSize: AppConstants().small_text_fontSize,
// color: themeController.currentColor.sc4),
// ),
// ],
// ),
// ],
// ),
// ),
// ),
// SizedBox(
// height: 52.rpx,
// ),
// ],
// ),
// ),
// );
// } catch (e) {
// es.EasyDartModule.logger.error("打鼾监测绘制异常${e}");
// return Container();
// }
// }
// List<Map<String, dynamic>> convertToShowLabel(
// List<Map<String, dynamic>> data) {
// if (data.isEmpty) return [];
// data.sort((a, b) => a['st'].compareTo(b['st'])); // 确保时间有序
// List<Map<String, dynamic>> result = [];
// int startTime = data[0]['st'];
// int endTime = data[0]['et'];
// int currentValue = data[0]['value'];
// for (int i = 1; i < data.length; i++) {
// final item = data[i];
// final st = item['st'];
// final value = item['value'];
// final et = item['et'];
// if (value == currentValue) {
// endTime = st;
// } else {
// result.add({
// "startTime": startTime,
// "endTime": endTime,
// "times": currentValue,
// });
// startTime = st;
// endTime = et;
// currentValue = value;
// }
// }
// // 添加最后一段
// result.add({
// "startTime": startTime,
// "endTime": endTime,
// "times": currentValue,
// });
// return result;
// }
// }
import 'package:EasyDartModule/EasyDartModule.dart' as es;
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';

View File

@@ -42,11 +42,15 @@ class _TrendDataTablePageState extends State<TrendDataTablePage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
widget.title,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
Expanded(
child: Text(
widget.title,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
ClickableContainer(

View File

@@ -47,11 +47,15 @@ class IndicatorCompareCard extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title.tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().title_text_fontSize,
Expanded(
child: Text(
title.tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().title_text_fontSize,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
if (tooltip != null)

View File

@@ -181,7 +181,7 @@ class _VitalSignsWidgetState extends State<VitalSignsWidget> {
'person_show': false,
'itemName': 206,
'retrun_fresh': true,
'reportPadding':false,
'reportPadding': false,
});
if (widget.onRefresh != null) {
widget.onRefresh!();
@@ -247,6 +247,8 @@ class _VitalSignsWidgetState extends State<VitalSignsWidget> {
color: stringToColor("#929699"),
fontSize: AppConstants().normal_text_fontSize,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),

View File

@@ -82,11 +82,15 @@ class _ZiZhuShenJingPercentWidgetState
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"自主神经平衡指数".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().title_text_fontSize),
Expanded(
child: Text(
"自主神经平衡指数".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontSize: AppConstants().title_text_fontSize),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
ClickableContainer(
backgroundColor: Colors.transparent,
@@ -95,7 +99,8 @@ class _ZiZhuShenJingPercentWidgetState
14.rpx, 10.rpx, 14.rpx, 10.rpx), //
borderRadius: 0.rpx, // 圆形点击区域
onTap: () {
if (AppConstants().ent_type == APPPackageType.MHT.code) {
if (AppConstants().ent_type ==
APPPackageType.MHT.code) {
showTipDialog(
context,
Container(