更新睡眠报告

This commit is contained in:
wyf
2025-05-29 20:20:49 +08:00
parent b34737dbe8
commit 7a816922fa
41 changed files with 4604 additions and 2394 deletions

View File

@@ -62,6 +62,7 @@ class _WifiPageState extends State<WifiPage> {
// textColor: themeController.currentColor.sc2,
// );
// });
blueteethBindController.blueConnectFlag.value = 2;
blueteethBindController.currentDevice = bledevice;
if (lisObj != null) {
lisObj!.cancel();
@@ -116,6 +117,8 @@ class _WifiPageState extends State<WifiPage> {
}
});
} else {
blueteethBindController.blueConnectFlag.value = 0;
blueteethBindController.updateAll();
dealWifi(widget.type['mac']).then((aa) {
print("object");
});
@@ -175,21 +178,50 @@ class _WifiPageState extends State<WifiPage> {
SizedBox(
width: 14.rpx,
),
Obx(() {
if (blueteethBindController.connectStatus.value ==
0) {
return SizedBox(
width: 24.rpx,
height: 24.rpx,
child: CircularProgressIndicator(
strokeWidth: 1,
valueColor:
AlwaysStoppedAnimation<Color>(Colors.white),
),
);
}
return Container();
}),
if (widget.type == null)
Obx(() {
if (blueteethBindController.connectStatus.value ==
0) {
return SizedBox(
width: 24.rpx,
height: 24.rpx,
child: CircularProgressIndicator(
strokeWidth: 1,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.white),
),
);
}
return Container();
}),
if (widget.type != null)
Obx(() {
if (blueteethBindController.blueConnectFlag.value ==
0) {
return SizedBox(
width: 24.rpx,
height: 24.rpx,
child: CircularProgressIndicator(
strokeWidth: 1,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.white),
),
);
}
if (blueteethBindController.connectStatus.value ==
0&&blueteethBindController.blueConnectFlag.value ==0) {
return SizedBox(
width: 24.rpx,
height: 24.rpx,
child: CircularProgressIndicator(
strokeWidth: 1,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.white),
),
);
}
return Container();
}),
],
),
@@ -717,6 +749,20 @@ class _WifiPageState extends State<WifiPage> {
horizontal: 20.rpx, vertical: 10.rpx),
borderRadius: 20.rpx,
onTap: () async {
if ((blueteethBindController
.blueConnectFlag ==
0 ||
blueteethBindController
.blueConnectFlag ==
1) &&
widget.type != null) {
blueteethBindController
.blueConnectFlag.value = 0;
dealWifi(widget.type['mac']).then((aa) {
print("object");
});
return;
}
blueteethBindController
.connectStatus.value = 0;
blueteethBindController.updateAll();
@@ -957,6 +1003,8 @@ class _WifiPageState extends State<WifiPage> {
timeoutTimer = Timer(Duration(seconds: 20), () {
try {
if (!isConnected) {
blueteethBindController.blueConnectFlag.value = 1;
blueteethBindController.updateAll();
// Navigator.of(context).pop(); // 先关闭 dialog
WidgetsBinding.instance.addPostFrameCallback((_) {
TopSlideNotification.show(
@@ -1005,6 +1053,7 @@ class _WifiPageState extends State<WifiPage> {
var res2 = bledevice.isConnected;
if (res2) {
// Navigator.pop(context);
blueteethBindController.blueConnectFlag.value = 2;
TopSlideNotification.show(
context,
text: "蓝牙绑定.连接成功".tr,