更新日报图标说明
This commit is contained in:
@@ -37,108 +37,110 @@ class _SkinPercentWidgetState extends State<SkinPercentWidget> {
|
||||
Widget build(BuildContext context) {
|
||||
try {
|
||||
if (widget.sleepReport == null ||
|
||||
widget.sleepReport['sicp'] == null ||
|
||||
widget.sleepReport['sicp'].isEmpty) {
|
||||
return Container();
|
||||
}
|
||||
int id = 100001;
|
||||
List data = widget.sleepReport['sicp'];
|
||||
final target = data.firstWhere(
|
||||
(element) => element['id'] == id,
|
||||
orElse: () => null, // 如果没有找到,返回 null(你也可以抛异常或用 {} 替代)
|
||||
);
|
||||
widget.sleepReport['sicp'] == null ||
|
||||
widget.sleepReport['sicp'].isEmpty) {
|
||||
return Container();
|
||||
}
|
||||
int id = 100001;
|
||||
List data = widget.sleepReport['sicp'];
|
||||
final target = data.firstWhere(
|
||||
(element) => element['id'] == id,
|
||||
orElse: () => null, // 如果没有找到,返回 null(你也可以抛异常或用 {} 替代)
|
||||
);
|
||||
|
||||
if (target == null) {
|
||||
return Container();
|
||||
}
|
||||
List<Map<String, dynamic>> showLabel = [];
|
||||
if (target != null && target['type'] is List) {
|
||||
showLabel = (target['type'] as List).map<Map<String, dynamic>>((item) {
|
||||
return {
|
||||
'key': item['type'],
|
||||
'name': item['name'],
|
||||
'color': stringToColor(item['color']),
|
||||
};
|
||||
}).toList();
|
||||
}
|
||||
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, 45.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, 0.rpx, 14.rpx, 0), //
|
||||
borderRadius: 0.rpx, // 圆形点击区域
|
||||
onTap: () {
|
||||
showTipDialog(
|
||||
context,
|
||||
Container(
|
||||
child: Text(
|
||||
"皮肤指数介绍".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
if (target == null) {
|
||||
return Container();
|
||||
}
|
||||
List<Map<String, dynamic>> showLabel = [];
|
||||
if (target != null && target['type'] is List) {
|
||||
showLabel = (target['type'] as List).map<Map<String, dynamic>>((item) {
|
||||
return {
|
||||
'key': item['type'],
|
||||
'name': item['name'],
|
||||
'color': stringToColor(item['color']),
|
||||
};
|
||||
}).toList();
|
||||
}
|
||||
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, 45.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, 0.rpx, 14.rpx, 0), //
|
||||
borderRadius: 0.rpx, // 圆形点击区域
|
||||
onTap: () {
|
||||
showTipDialog(
|
||||
context,
|
||||
Container(
|
||||
child: Text(
|
||||
// "皮肤指数介绍".tr,
|
||||
"皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。"
|
||||
.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
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,
|
||||
),
|
||||
);
|
||||
},
|
||||
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: 83.rpx,
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(30.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
child: StatusBarWithIndicator(
|
||||
selectKey: target['value'],
|
||||
showLabel: showLabel,
|
||||
SizedBox(
|
||||
height: 83.rpx,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 56.rpx,
|
||||
),
|
||||
],
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
child: StatusBarWithIndicator(
|
||||
selectKey: target['value'],
|
||||
showLabel: showLabel,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 56.rpx,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
);
|
||||
} catch (e) {
|
||||
es.EasyDartModule.logger.error("打鼾监测绘制异常${e}");
|
||||
es.EasyDartModule.logger.error("打鼾监测绘制异常${e}");
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user