更新
This commit is contained in:
141
lib/pages/sleep_report/component/BreathPauseWidget.dart
Normal file
141
lib/pages/sleep_report/component/BreathPauseWidget.dart
Normal file
@@ -0,0 +1,141 @@
|
||||
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/pages/device_bind/componnet/bind_dialog.dart';
|
||||
import 'package:vbvs_app/pages/sleep_report/chart/DotBarChart.dart';
|
||||
|
||||
class BreathPauseWidget extends StatefulWidget {
|
||||
BreathPauseWidget({super.key});
|
||||
|
||||
@override
|
||||
State<BreathPauseWidget> createState() => _BreathPauseWidgetState();
|
||||
}
|
||||
|
||||
class _BreathPauseWidgetState extends State<BreathPauseWidget> {
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// var showLabel = [
|
||||
// {"time": 1744547251000, "times": 20},
|
||||
// {"time": 1744550851000, "times": 50},
|
||||
// {"time": 1744554451000, "times": 20},
|
||||
// {"time": 1744558051000, "times": 30},
|
||||
// {"time": 1744561651000, "times": 20},
|
||||
// {"time": 1744565251000, "times": 10},
|
||||
// {"time": 1744568851000, "times": 20},
|
||||
// {"time": 1744572451000, "times": 20},
|
||||
// {"time": 1744583251000, "times": 100},
|
||||
// {"time": 1744586851000, "times": 20},
|
||||
// ];
|
||||
var showLabel = [
|
||||
{"time": 1744547251000, "times": 25},
|
||||
{"time": 1744550851000, "times": 27},
|
||||
{"time": 1744554451000, "times": 40},
|
||||
{"time": 1744558051000, "times": 28},
|
||||
{"time": 1744561651000, "times": 15},
|
||||
{"time": 1744565251000, "times": 48},
|
||||
{"time": 1744568851000, "times": 25},
|
||||
{"time": 1744572451000, "times": 17},
|
||||
{"time": 1744583251000, "times": 35},
|
||||
{"time": 1744586851000, "times": 40},
|
||||
];
|
||||
var threshold = 40;
|
||||
var startTime = 1744641151000;
|
||||
var endTime = 1744677151000;
|
||||
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, 0.rpx, 14.rpx, 0), //
|
||||
borderRadius: 0.rpx, // 圆形点击区域
|
||||
onTap: () {
|
||||
showTipDialog(
|
||||
context,
|
||||
Container(
|
||||
child: Text(
|
||||
"呼吸暂停监测介绍。",
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 32.rpx,
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
child: DotBarChart(
|
||||
showLabel: showLabel,
|
||||
threshold: threshold,
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 52.rpx,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user