更新睡眠的心率基准图不显示
This commit is contained in:
@@ -36,177 +36,176 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
controller.getPeoples (data['mac']);
|
||||
controller.getPeoples(data['mac']);
|
||||
});
|
||||
return LayoutBuilder(
|
||||
builder: (context, boxConstraints) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
// onTap: () => FocusScope.of(context).unfocus(),,
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||
fit: BoxFit.fill, // 填满整个 Container
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||
fit: BoxFit.fill, // 填满整个 Container
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: Colors.white),
|
||||
titleSpacing: 0,
|
||||
title: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: Colors.white),
|
||||
titleSpacing: 0,
|
||||
title: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
iconTheme: const IconThemeData(color: Colors.white),
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
title: SizedBox(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'详情',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 0.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
centerTitle: false,
|
||||
),
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Obx(
|
||||
() => Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 30.rpx, right: 30.rpx, top: 30.rpx),
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 1.123,
|
||||
// decoration: BoxDecoration(
|
||||
// // color: AppColors.bg_color,
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage("assets/images/background.png"),
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// ),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
ClickableContainer(
|
||||
backgroundColor: Color(0xFFFF036060),
|
||||
highlightColor: Colors.transparent,
|
||||
borderRadius: 16.rpx,
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
30.rpx, 20.rpx, 0, 20.rpx),
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(16.rpx)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'设备信息',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
),
|
||||
getInfoRow(
|
||||
context, "名称:${data["name"] ?? "-"}"),
|
||||
getInfoRow(context,
|
||||
"房间:${data["roomName"] ?? "-"}"),
|
||||
getInfoRow(
|
||||
context,
|
||||
"设备状态:${data["status"]?["status"] == 1 ? "已绑定" : data["status"]?["status"] == 0 ? "已绑定" : "-"}",
|
||||
),
|
||||
getInfoRow(
|
||||
context, "MAC:${data["mac"] ?? "-"}"),
|
||||
],
|
||||
),
|
||||
)),
|
||||
if (controller.model.peopleList.isNotEmpty)
|
||||
...List.generate(controller.model.peopleList.length,
|
||||
(index) {
|
||||
final person = controller.model.peopleList[index];
|
||||
// String location_ = '';
|
||||
// if ("${data["bindMacB"]}".length > 6 &&
|
||||
// (person["direction"] == 1 ||
|
||||
// person["direction"] == 2)) {
|
||||
// location_ =
|
||||
// person["direction"] == 1 ? '左侧' : '右侧';
|
||||
// }
|
||||
|
||||
return ClickableContainer(
|
||||
backgroundColor: Color(0xFF003058),
|
||||
highlightColor: Color(0xFF036060),
|
||||
borderRadius: 16.rpx,
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
30.rpx, 20.rpx, 30.rpx, 20.rpx),
|
||||
onTap: () {},
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'人员资料${index == 0 ? "A" : "B"}',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 32.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
getInfoRow(
|
||||
context, "姓名:${person["name"] ?? "-"}"),
|
||||
getInfoRow(context,
|
||||
"性别:${person["gender"] == null ? "-" : (person["gender"] == 1 ? "男" : "女")}"),
|
||||
getInfoRow(context,
|
||||
"身高:${person["height"] == null ? "-" : "${person["height"]}cm"}"),
|
||||
getInfoRow(context,
|
||||
"体重:${person["weight"] == null ? "-" : "${person["weight"]}kg"}"),
|
||||
getInfoRow(context,
|
||||
"生日:${person["birthday"] == null ? "-" : time_08_Formatter_pattern(person["birthday"], "yyyy年MM月dd日")}"),
|
||||
getInfoRow(
|
||||
context, "电话:${person["tel"] ?? "-"}"),
|
||||
getInfoRow(context,
|
||||
"紧急联系人:${person["contact"] ?? "-"}"),
|
||||
],
|
||||
),
|
||||
);
|
||||
})
|
||||
].divide(SizedBox(
|
||||
height: 25.rpx,
|
||||
)),
|
||||
iconTheme: const IconThemeData(color: Colors.white),
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
title: SizedBox(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'详情',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 0.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
centerTitle: false,
|
||||
),
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Obx(
|
||||
() => Container(
|
||||
padding:
|
||||
EdgeInsets.only(left: 30.rpx, right: 30.rpx, top: 30.rpx),
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 1.123,
|
||||
// decoration: BoxDecoration(
|
||||
// // color: AppColors.bg_color,
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage("assets/images/background.png"),
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// ),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
ClickableContainer(
|
||||
backgroundColor: Color(0xFFFF036060),
|
||||
highlightColor: Colors.transparent,
|
||||
borderRadius: 16.rpx,
|
||||
padding:
|
||||
EdgeInsets.fromLTRB(30.rpx, 20.rpx, 0, 20.rpx),
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16.rpx)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'设备信息',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
),
|
||||
getInfoRow(
|
||||
context, "名称:${data["name"] ?? "-"}"),
|
||||
getInfoRow(
|
||||
context, "房间:${data["roomName"] ?? "-"}"),
|
||||
getInfoRow(
|
||||
context,
|
||||
"设备状态:${data["status"]?["status"] == 1 ? "已绑定" : data["status"]?["status"] == 0 ? "已绑定" : "-"}",
|
||||
),
|
||||
getInfoRow(
|
||||
context, "MAC:${data["mac"] ?? "-"}"),
|
||||
],
|
||||
),
|
||||
)),
|
||||
if (controller.model.peopleList.isNotEmpty)
|
||||
...List.generate(controller.model.peopleList.length,
|
||||
(index) {
|
||||
final person = controller.model.peopleList[index];
|
||||
// String location_ = '';
|
||||
// if ("${data["bindMacB"]}".length > 6 &&
|
||||
// (person["direction"] == 1 ||
|
||||
// person["direction"] == 2)) {
|
||||
// location_ =
|
||||
// person["direction"] == 1 ? '左侧' : '右侧';
|
||||
// }
|
||||
|
||||
return ClickableContainer(
|
||||
backgroundColor: Color(0xFF003058),
|
||||
highlightColor: Color(0xFF036060),
|
||||
borderRadius: 16.rpx,
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
30.rpx, 20.rpx, 30.rpx, 20.rpx),
|
||||
onTap: () {},
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'人员资料${index == 0 ? "A" : "B"}',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
fontSize: 32.rpx,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
getInfoRow(
|
||||
context, "姓名:${person["name"] ?? "-"}"),
|
||||
getInfoRow(context,
|
||||
"性别:${person["gender"] == null ? "-" : (person["gender"] == 1 ? "男" : "女")}"),
|
||||
getInfoRow(context,
|
||||
"身高:${person["height"] == null ? "-" : "${person["height"]}cm"}"),
|
||||
getInfoRow(context,
|
||||
"体重:${person["weight"] == null ? "-" : "${person["weight"]}kg"}"),
|
||||
getInfoRow(context,
|
||||
"生日:${person["birthday"] == null ? "-" : time_08_Formatter_pattern(person["birthday"], "yyyy年MM月dd日")}"),
|
||||
getInfoRow(
|
||||
context, "电话:${person["tel"] ?? "-"}"),
|
||||
getInfoRow(context,
|
||||
"紧急联系人:${person["contact"] ?? "-"}"),
|
||||
],
|
||||
),
|
||||
);
|
||||
})
|
||||
].divide(SizedBox(
|
||||
height: 25.rpx,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user