This commit is contained in:
wyf
2025-08-15 10:16:35 +08:00
parent b2fd885192
commit 7cffe978ae
11 changed files with 253 additions and 197 deletions

View File

@@ -12,7 +12,12 @@ import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.d
//睡眠规律性
class VitalSignsWidget extends StatefulWidget {
var sleepReport;
VitalSignsWidget({super.key, required this.sleepReport});
final VoidCallback? onRefresh; // 添加回调函数
VitalSignsWidget({
super.key,
required this.sleepReport,
this.onRefresh, // 可选参数
});
@override
State<VitalSignsWidget> createState() => _VitalSignsWidgetState();
@@ -166,16 +171,20 @@ class _VitalSignsWidgetState extends State<VitalSignsWidget> {
),
Row(mainAxisAlignment: MainAxisAlignment.end, children: [
OutlinedButton(
onPressed: () {
onPressed: () async {
MHTHomeController homeController = Get.find();
Get.toNamed("/newSleepReportPage", arguments: {
await Get.toNamed("/newSleepReportPage", arguments: {
'date': widget.sleepReport['endTime'],
"mac": homeController.selectDevcie.value,
'type': 1,
'backgroundImg': 'assets/images/new_background.png',
'person_show': false,
'itemName': 206,
'retrun_fresh': true,
});
if (widget.onRefresh != null) {
widget.onRefresh!();
}
},
style: OutlinedButton.styleFrom(
side: const BorderSide(color: Color(0XFF85F5FF)),