diff --git a/assets/img/icon/triangle.svg b/assets/img/icon/triangle.svg
new file mode 100644
index 0000000..bfd6690
--- /dev/null
+++ b/assets/img/icon/triangle.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/img/xiaoe.png b/assets/img/xiaoe.png
new file mode 100644
index 0000000..4254142
Binary files /dev/null and b/assets/img/xiaoe.png differ
diff --git a/assets/langs/en_US.json b/assets/langs/en_US.json
index 43ac062..4399497 100644
--- a/assets/langs/en_US.json
+++ b/assets/langs/en_US.json
@@ -321,7 +321,7 @@
"ios启用网络提示":"",
"设备报修":"Device repair",
"联系人":"Contact",
- "手机号":"Phone number",
+ "手机号":"Phone",
"名称输入提示":"Enter contact name",
"手机号输入提示":"Enter contact phone number",
"提交":"Submit",
@@ -398,7 +398,7 @@
"全部消息":"All messages",
"请先在设置里的消息通知打开全部消息配置":"Please enable all message notifications in settings first",
"请先打开全部消息配置":"Please enable all message notifications first",
- "正常值":"Normal range:",
+ "正常值":"range:",
"今日":"Today",
"深色":"Dark",
"皮肤指数":"Skin index",
diff --git a/assets/langs/zh_CN.json b/assets/langs/zh_CN.json
index 5d6ea38..4a86f2f 100644
--- a/assets/langs/zh_CN.json
+++ b/assets/langs/zh_CN.json
@@ -421,7 +421,8 @@
"心率散点图介绍":"心电散点图是用非线性的图形方法描记的连续心冲击图的RR间期图,因图形由散点组成,又称散点图。",
"今日数据":"今日数据",
"昨日数据":"昨日数据",
- "次":"次",
- "秒":"秒"
+ "次":"频次",
+ "秒":"秒",
+ "当前暂无数据":"当前暂无数据"
}
\ No newline at end of file
diff --git a/lib/component/home_page/DynamicReportDetailWidget.dart b/lib/component/home_page/DynamicReportDetailWidget.dart
index 54336c8..4cb025f 100644
--- a/lib/component/home_page/DynamicReportDetailWidget.dart
+++ b/lib/component/home_page/DynamicReportDetailWidget.dart
@@ -9,6 +9,7 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/home_page/SleepDataModuleWidget.dart';
import 'package:vbvs_app/component/home_page/SleepDateWidget.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
+import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
class DynamicReportDetailWidget extends StatefulWidget {
@@ -38,7 +39,7 @@ class _DynamicReportDetailWidgetState extends State {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
- Future.delayed(Duration(milliseconds: 100), () {
+ Future.delayed(Duration(milliseconds: 500), () {
if (!_hasScrolled &&
_scrollController.hasClients &&
_scrollController.position.maxScrollExtent > 0) {
@@ -121,6 +122,8 @@ class _DynamicReportDetailWidgetState extends State {
String sleepReportUrl =
"${ServiceConstant.sleep_report_url}?mac=$mac&token=${ServiceConstant.sleep_token}&date=$time";
Get.toNamed("/sleepReportPage", arguments: sleepReportUrl);
+ } else {
+ TopSlideNotification.show(context,text: "当前暂无数据".tr,textColor: themeController.currentColor.sc9);
}
},
child: Row(
diff --git a/lib/component/home_page/SleepDataModuleWidget.dart b/lib/component/home_page/SleepDataModuleWidget.dart
index e3a0505..5414058 100644
--- a/lib/component/home_page/SleepDataModuleWidget.dart
+++ b/lib/component/home_page/SleepDataModuleWidget.dart
@@ -79,156 +79,181 @@ class _SleepDataModuleWidgetState extends State {
showTipDialog(
backgroundColor: stringToColor("#FFFFFF"),
context,
- Column(
- children: [
- Text(
- "${widget.data['name']}",
- style: TextStyle(
- color: stringToColor("#333333"),
- fontSize: 36.rpx,
- ),
- ),
- SizedBox(
- height: 17.rpx,
- ),
- Text(
- (widget.data['tips']?.toString().trim().isNotEmpty ?? false)
- ? widget.data['tips'].toString()
- : "未知数据".tr,
- style: TextStyle(
- color: stringToColor("#C8CBD2"),
- fontSize: 26.rpx,
- ),
- ),
- SizedBox(
- height: 37.rpx,
- ),
- Text(
- "${widget.data['value']}",
- style: TextStyle(
- color: stringToColor("${widget.data['color']}"),
- fontSize: 60.rpx,
- ),
- ),
- SizedBox(
- height: 81.rpx,
- ),
- IntrinsicHeight(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- for (int i = 0; i < levelGroups.length; i++) ...[
- // 每个 levelGroup 区域
- Expanded(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- // Level 名称
- Text(
- levelGroups[i]['levelName'],
- style: TextStyle(
- fontSize: 30.rpx,
- color: stringToColor("#333333"),
- fontWeight: FontWeight.bold,
- ),
- ),
- SizedBox(height: 38.rpx),
+ Container(
+ constraints: BoxConstraints(
+ maxHeight: 700.rpx,
+ ),
+ child: SingleChildScrollView(
+ child: Column(
+ children: [
+ Text(
+ "${widget.data['name']}",
+ style: TextStyle(
+ color: stringToColor("#333333"),
+ fontSize: 36.rpx,
+ ),
+ ),
+ SizedBox(
+ height: 17.rpx,
+ ),
+ Text(
+ (widget.data['tips']?.toString().trim().isNotEmpty ??
+ false)
+ ? widget.data['tips'].toString()
+ : "未知数据".tr,
+ style: TextStyle(
+ color: stringToColor("#C8CBD2"),
+ fontSize: 26.rpx,
+ ),
+ ),
+ SizedBox(
+ height: 37.rpx,
+ ),
+ Text(
+ "${widget.data['value']}" +
+ ((widget.data['unit'] == null ||
+ widget.data['unit'].toString().isEmpty)
+ ? ''
+ : widget.data['unit']),
+ style: TextStyle(
+ color: stringToColor("${widget.data['color']}"),
+ fontSize: 60.rpx,
+ ),
+ ),
+ SizedBox(
+ height: 81.rpx,
+ ),
+ IntrinsicHeight(
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ for (int i = 0; i < levelGroups.length; i++) ...[
+ // 每个 levelGroup 区域
+ Expanded(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ // Level 名称
+ Text(
+ levelGroups[i]['levelName'],
+ style: TextStyle(
+ fontSize: 30.rpx,
+ color: stringToColor("#333333"),
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ SizedBox(height: 38.rpx),
- // 颜色圆点 + key(包一层,和 svg 分离)
- Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceAround,
- crossAxisAlignment:
- CrossAxisAlignment.start, // 上对齐,避免撑高分割线
- children:
- levelGroups[i]['items'].map((item) {
- final bool isSelected =
- (item['key'] == itemLevel);
- return Column(
- children: [
- // 颜色圆点 + key(参与分割线高度)
- Column(
+ // 颜色圆点 + key(包一层,和 svg 分离)
+ Row(
+ mainAxisAlignment:
+ MainAxisAlignment.spaceAround,
+ crossAxisAlignment:
+ CrossAxisAlignment.start, // 上对齐,避免撑高分割线
+ children: levelGroups[i]['items']
+ .map((item) {
+ final bool isSelected =
+ (item['key'] == itemLevel);
+ return Column(
children: [
- Container(
- width: 20.rpx,
- height: 20.rpx,
- decoration: BoxDecoration(
- color:
- stringToColor(item['color']),
- shape: BoxShape.circle,
- ),
- ),
- SizedBox(height: 30.rpx),
- Text(
- item['key'],
- style: TextStyle(
- color: stringToColor("#333333"),
- fontSize: 20.rpx,
- ),
+ // 颜色圆点 + key(参与分割线高度)
+ Column(
+ children: [
+ Container(
+ width: 20.rpx,
+ height: 20.rpx,
+ decoration: BoxDecoration(
+ color: stringToColor(
+ item['color']),
+ shape: BoxShape.circle,
+ ),
+ ),
+ SizedBox(height: 30.rpx),
+ Text(
+ item['key'],
+ style: TextStyle(
+ color:
+ stringToColor("#333333"),
+ fontSize: 20.rpx,
+ ),
+ ),
+ ],
),
+
+ // svg 箭头(不影响分割线高度)
+ SizedBox(height: 20.rpx),
+ isSelected
+ ? SvgPicture.asset(
+ 'assets/img/icon/triangle.svg',
+ width: 18.rpx,
+ height: 18.rpx,
+ color: themeController
+ .currentColor.sc9,
+ )
+ : SizedBox(height: 18.rpx),
],
- ),
-
- // svg 箭头(不影响分割线高度)
- SizedBox(height: 20.rpx),
- isSelected
- ? SvgPicture.asset(
- 'assets/img/icon/triangle.svg',
- width: 18.rpx,
- height: 18.rpx,
- color: themeController
- .currentColor.sc9,
- )
- : SizedBox(height: 18.rpx),
- ],
- );
- }).toList(),
+ );
+ }).toList(),
+ ),
+ ],
),
- ],
- ),
- ),
+ ),
- // 分割线(只和主要内容等高)
- if (i != levelGroups.length - 1)
- Container(
- width: 1.rpx,
- color: stringToColor("${widget.data['color']}"),
- margin: EdgeInsets.symmetric(horizontal: 10.rpx),
+ // 分割线(只和主要内容等高)
+ if (i != levelGroups.length - 1)
+ Container(
+ width: 1.rpx,
+ color: Colors.grey.withOpacity(0.5),
+ margin:
+ EdgeInsets.symmetric(horizontal: 10.rpx),
+ ),
+ ]
+ ],
+ ),
+ ),
+ SizedBox(
+ height: 71.rpx,
+ ),
+ RichText(
+ text: TextSpan(
+ children: [
+ TextSpan(
+ text: "当前属于".tr, // 第一部分文本
+ style: TextStyle(
+ color: Colors.black, // 你想要的样式
+ fontSize: 30.rpx,
+ ),
),
- ]
- ],
- ),
- ),
- SizedBox(
- height: 71.rpx,
- ),
- RichText(
- text: TextSpan(
- children: [
- TextSpan(
- text: "当前属于".tr, // 第一部分文本
- style: TextStyle(
- color: Colors.black, // 你想要的样式
- fontSize: 30.rpx,
- ),
+ TextSpan(
+ text: itemLevel, // 第二部分文本
+ style: TextStyle(
+ color: stringToColor("${widget.data['color']}"),
+ fontSize: 30.rpx,
+ ),
+ ),
+ ],
),
- TextSpan(
- text: itemLevel, // 第二部分文本
- style: TextStyle(
- color: stringToColor("${widget.data['color']}"),
- fontSize: 30.rpx,
- ),
- ),
- ],
- ),
+ ),
+ ],
),
- ],
+ ),
),
);
}
+ if (widget.data['onto'] != null && widget.data['onto'] == true) {
+ //跳转睡眠报告
+ Get.toNamed("/newSleepReportPage", arguments: {
+ 'date': widget.data['time'] != null
+ ? int.parse(widget.data['time'].toString())
+ : DateTime.now().millisecondsSinceEpoch,
+ "mac": 'aaaaaaeeeeeq',
+ 'type': 1,
+ 'name': 'sleep', //'sleep', 'heartRate' 或 'breathe'
+ 'itemName': widget.data['id'],
+ });
+ }
},
child: Container(
- // width: MediaQuery.sizeOf(context).width * 0.267,
width: MediaQuery.sizeOf(context).width * 0.267,
constraints: BoxConstraints(
minWidth: 200.rpx,
@@ -251,40 +276,80 @@ class _SleepDataModuleWidgetState extends State {
overflow: TextOverflow.ellipsis,
),
Row(
- mainAxisSize: MainAxisSize.max,
+ mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Row(
- mainAxisSize: MainAxisSize.max,
- crossAxisAlignment: CrossAxisAlignment.end,
- children: [
- Text(
- '${widget.data['value']}',
- style: FlutterFlowTheme.of(context).bodyMedium.override(
+ // Expanded(
+ // child: Row(
+ // mainAxisSize: MainAxisSize.min,
+ // crossAxisAlignment: CrossAxisAlignment.end,
+ // children: [
+ // Text(
+ // '${widget.data['value']}',
+ // style: FlutterFlowTheme.of(context).bodyMedium.override(
+ // fontFamily: 'Inter',
+ // fontSize: 36.rpx,
+ // letterSpacing: 0.0,
+ // color: themeController.currentColor.sc3,
+ // ),
+ // maxLines: 1,
+ // overflow: TextOverflow.ellipsis,
+ // ),
+ // Padding(
+ // padding:
+ // EdgeInsetsDirectional.fromSTEB(0, 0, 0, 10.rpx),
+ // child: Text(
+ // '${widget.data['unit'] ?? ''}',
+ // style: FlutterFlowTheme.of(context)
+ // .bodyMedium
+ // .override(
+ // fontFamily: 'Inter',
+ // fontSize: AppConstants().small_text_fontSize,
+ // letterSpacing: 0.0,
+ // color: themeController.currentColor.sc3,
+ // ),
+ // maxLines: 1,
+ // overflow: TextOverflow.ellipsis,
+ // ),
+ // ),
+ // ],
+ // ),
+ // ),
+ Expanded(
+ child: Text.rich(
+ TextSpan(
+ children: [
+ TextSpan(
+ text: '${widget.data['value']}',
+ style: TextStyle(
fontFamily: 'Inter',
fontSize: 36.rpx,
letterSpacing: 0.0,
color: themeController.currentColor.sc3,
),
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
+ ),
+ WidgetSpan(child: SizedBox(width: 2.rpx)), // 可选间距
+ TextSpan(
+ text: widget.data['unit'] != null
+ ? '${widget.data['unit']}'
+ : '',
+ style: TextStyle(
+ fontFamily: 'Inter',
+ fontSize: AppConstants().small_text_fontSize,
+ letterSpacing: 0.0,
+ color: themeController.currentColor.sc3,
+ ),
+ ),
+ ],
),
- Padding(
- padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 10.rpx),
- child: Text(
- '${widget.data['unit'] ?? ''}',
- style: FlutterFlowTheme.of(context).bodyMedium.override(
- fontFamily: 'Inter',
- fontSize: AppConstants().small_text_fontSize,
- letterSpacing: 0.0,
- color: themeController.currentColor.sc3,
- ),
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- ),
- ),
- ],
+ maxLines: 1,
+ style: TextStyle(
+ color:
+ themeController.currentColor.sc3), // 强制 ellipsis 颜色
+ overflow: TextOverflow.ellipsis,
+ ),
),
+
if (widget.data['level'] != null)
ClickableContainer(
backgroundColor: (widget.data['color'] == null ||
diff --git a/lib/controller/device/blueteeth_bind_controller.dart b/lib/controller/device/blueteeth_bind_controller.dart
index f7886ec..4b27a5f 100644
--- a/lib/controller/device/blueteeth_bind_controller.dart
+++ b/lib/controller/device/blueteeth_bind_controller.dart
@@ -71,7 +71,8 @@ class BlueteethBindController extends GetControllerEx {
RxString search = "".obs; //搜索关键字
- RxInt connectStatus = 0.obs;
+ RxInt connectStatus = 0.obs;//当前wifi连接状态 0:未连接 1:已连接
+ RxInt blueConnectFlag = 0.obs;//当前蓝牙连接状态 0.正在连接 1.为连接 2.已连接
RxMap selectWifi = {}.obs; //正在连接wifi信息
diff --git a/lib/controller/weather/weather_controller.dart b/lib/controller/weather/weather_controller.dart
index b5d91e3..6fa1397 100644
--- a/lib/controller/weather/weather_controller.dart
+++ b/lib/controller/weather/weather_controller.dart
@@ -256,6 +256,9 @@ class WeatherModelController extends GetControllerEx {
Future _getCurrentLocation() async {
try {
Position position = await _determinePosition();
+ if (position == null) {
+ throw Exception("获取位置失败");
+ }
String? language = "zh_CN";
if (languageController.selectLanguage != null) {
diff --git a/lib/main.dart b/lib/main.dart
index 43503b0..a2be13c 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -103,13 +103,13 @@ void startMessagePolling() {
// 避免重复启动
_messageTimer?.cancel();
- _messageTimer = Timer.periodic(Duration(seconds: 5), (timer) async {
+ _messageTimer = Timer.periodic(Duration(seconds: 10), (timer) async {
try {
MessageController messageController = Get.find();
messageController.getMessageStatus();
// print("轮询消息状态成功");
} catch (e) {
- print("轮询消息状态失败: $e");
+ print("轮询消息状态失败: $e");
}
});
}
diff --git a/lib/pages/device/component/DeviceDataComponentWidget.dart b/lib/pages/device/component/DeviceDataComponentWidget.dart
index ce61e34..1109440 100644
--- a/lib/pages/device/component/DeviceDataComponentWidget.dart
+++ b/lib/pages/device/component/DeviceDataComponentWidget.dart
@@ -1,9 +1,9 @@
import 'dart:async';
+import 'dart:math' as math;
+import 'dart:ui' as ui;
-import 'package:easydevice/easydevice.dart';
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
-import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/ServiceConstant.dart';
@@ -15,18 +15,12 @@ import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/component/tool/ToggleColorContainer.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
-import 'package:vbvs_app/component/tool/cmd.dart';
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
import 'package:vbvs_app/controller/device/body_device_controller.dart';
import 'package:vbvs_app/controller/person/person_controller.dart';
-import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
import 'package:vbvs_app/enum/BindType.dart';
-import 'package:vbvs_app/model/BleDeviceData.dart';
import 'package:vbvs_app/model/api_response.dart';
-import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
-import 'dart:math' as math;
-import 'dart:ui' as ui;
class DeviceDataComponentWidget extends StatefulWidget {
final Map device;
@@ -1040,7 +1034,7 @@ class _DeviceDataComponentWidgetState extends State {
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
- Expanded(
+ Expanded(
child: CustomCard(
borderRadius: AppConstants().button_container_radius,
onTap: () async {
@@ -1052,11 +1046,17 @@ class _DeviceDataComponentWidgetState extends State {
personController.gender.value =
widget.device['person']['gender'] ?? 1;
personController.weight?.value =
- widget.device['person']['weight'].toString() ??
- "";
+ widget.device['person']['weight'] == null
+ ? ''
+ : widget.device['person']['weight']
+ .toString();
+
personController.height.value =
- widget.device['person']['height'].toString() ??
- "";
+ widget.device['person']['height'] == null
+ ? ''
+ : widget.device['person']['height']
+ .toString();
+
personController.selectedDiseaseIds.value =
widget.device['person']['disease'] ?? [];
personController.birthday.value =
@@ -1165,7 +1165,8 @@ class _DeviceDataComponentWidgetState extends State {
borderRadius: AppConstants().button_container_radius,
onTap: () {
// TopSlideNotification.show(context, text: "待开发功能".tr);
- Get.toNamed("/messageReviewPage",arguments: widget.device);
+ Get.toNamed("/messageReviewPage",
+ arguments: widget.device);
},
colors: [
themeController.currentColor.sc1,
@@ -1463,19 +1464,3 @@ class _DeviceDataComponentWidgetState extends State {
}
}
}
-
-_showBluetoothNotEnabledDialog() async {
- await showDialog(
- context: Get.context!,
- builder: (_) => AlertDialog(
- title: Text("蓝牙未开启"),
- content: Text("请先打开蓝牙再进行WIFI配置"),
- actions: [
- TextButton(
- onPressed: () => Navigator.of(Get.context!).pop(),
- child: Text("知道了"),
- ),
- ],
- ),
- );
-}
diff --git a/lib/pages/device/instant_body_page.dart b/lib/pages/device/instant_body_page.dart
index f280997..5f35174 100644
--- a/lib/pages/device/instant_body_page.dart
+++ b/lib/pages/device/instant_body_page.dart
@@ -325,6 +325,7 @@ class _InstantBodyPageState extends State {
),
].divide(SizedBox(height: 34.rpx)),
),
+
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
@@ -342,6 +343,8 @@ class _InstantBodyPageState extends State {
color: themeController
.currentColor.sc3,
),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
),
Text(
'${device['person']?['weight'] ?? '未知数据'.tr}kg',
@@ -358,6 +361,7 @@ class _InstantBodyPageState extends State {
),
].divide(SizedBox(height: 34.rpx)),
),
+
]
.divide(SizedBox(width: 33.rpx))
.addToStart(SizedBox(width: 37.rpx)),
diff --git a/lib/pages/device_bind/blueteeth_device_page.dart b/lib/pages/device_bind/blueteeth_device_page.dart
index ab7f719..3e95083 100644
--- a/lib/pages/device_bind/blueteeth_device_page.dart
+++ b/lib/pages/device_bind/blueteeth_device_page.dart
@@ -6,6 +6,7 @@ import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:permission_handler/permission_handler.dart'; // 引入permission_handler
+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';
@@ -15,6 +16,7 @@ import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
import 'package:vbvs_app/model/BleDeviceData.dart';
import 'package:vbvs_app/pages/device_bind/componnet/SingleBlueteethDeviceCompoentWidget.dart';
+import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
class BlueteethDevicePage extends StatefulWidget {
int tid = -1;
@@ -730,19 +732,40 @@ class _BlueteethDevicePageState extends State {
}
_showBluetoothNotEnabledDialog() async {
- await showDialog(
- context: context,
- builder: (_) => AlertDialog(
- title: Text("蓝牙未开启"),
- content: Text("请先打开蓝牙再进行设备扫描"),
- actions: [
- TextButton(
- onPressed: () => Navigator.of(context).pop(),
- child: Text("知道了"),
- ),
- ],
- ),
- );
+ await showTipDialog(
+ context,
+ Column(
+ children: [
+ Text(
+ "蓝牙未开启".tr,
+ style: TextStyle(
+ fontSize: AppConstants().title_text_fontSize,
+ color: themeController.currentColor.sc3),
+ ),
+ SizedBox(
+ height: 20.rpx,
+ ),
+ Text(
+ "请先打开蓝牙在进行设备扫描".tr,
+ style: TextStyle(
+ fontSize: AppConstants().normal_text_fontSize,
+ color: themeController.currentColor.sc3),
+ ),
+ ],
+ ));
+ // await showDialog(
+ // context: context,
+ // builder: (_) => AlertDialog(
+ // title: Text("蓝牙未开启"),
+ // content: Text("请先打开蓝牙再进行设备扫描"),
+ // actions: [
+ // TextButton(
+ // onPressed: () => Navigator.of(context).pop(),
+ // child: Text("知道了"),
+ // ),
+ // ],
+ // ),
+ // );
}
}
diff --git a/lib/pages/device_bind/componnet/bind_dialog.dart b/lib/pages/device_bind/componnet/bind_dialog.dart
index 786020d..07f4e8d 100644
--- a/lib/pages/device_bind/componnet/bind_dialog.dart
+++ b/lib/pages/device_bind/componnet/bind_dialog.dart
@@ -860,7 +860,7 @@ void showWifiDialog(
);
}
-void showTipDialog(
+String showTipDialog(
BuildContext context,
Widget widget, {
Color? backgroundColor, // 新增可选参数
@@ -990,4 +990,5 @@ void showTipDialog(
);
},
);
+ return "";
}
diff --git a/lib/pages/device_bind/wifi_page.dart b/lib/pages/device_bind/wifi_page.dart
index ef96d7d..e4b6a82 100644
--- a/lib/pages/device_bind/wifi_page.dart
+++ b/lib/pages/device_bind/wifi_page.dart
@@ -62,6 +62,7 @@ class _WifiPageState extends State {
// textColor: themeController.currentColor.sc2,
// );
// });
+ blueteethBindController.blueConnectFlag.value = 2;
blueteethBindController.currentDevice = bledevice;
if (lisObj != null) {
lisObj!.cancel();
@@ -116,6 +117,8 @@ class _WifiPageState extends State {
}
});
} else {
+ blueteethBindController.blueConnectFlag.value = 0;
+ blueteethBindController.updateAll();
dealWifi(widget.type['mac']).then((aa) {
print("object");
});
@@ -175,21 +178,50 @@ class _WifiPageState extends State {
SizedBox(
width: 14.rpx,
),
- Obx(() {
- if (blueteethBindController.connectStatus.value ==
- 0) {
- return SizedBox(
- width: 24.rpx,
- height: 24.rpx,
- child: CircularProgressIndicator(
- strokeWidth: 1,
- valueColor:
- AlwaysStoppedAnimation(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(
+ 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(
+ 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(
+ Colors.white),
+ ),
+ );
+ }
+ return Container();
+ }),
],
),
@@ -717,6 +749,20 @@ class _WifiPageState extends State {
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 {
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 {
var res2 = bledevice.isConnected;
if (res2) {
// Navigator.pop(context);
+ blueteethBindController.blueConnectFlag.value = 2;
TopSlideNotification.show(
context,
text: "蓝牙绑定.连接成功".tr,
diff --git a/lib/pages/main_bottom/home_page.dart b/lib/pages/main_bottom/home_page.dart
index 5c32355..e60b380 100644
--- a/lib/pages/main_bottom/home_page.dart
+++ b/lib/pages/main_bottom/home_page.dart
@@ -1013,7 +1013,7 @@ class _HomePageState extends State {
(device) => device['mac'] == mac,
);
List stateModule = [];
-
+ String currentTime = "";
return DynamicReportDetailWidget(
targetDevice: targetDevice!,
sleepDateWidgets: List.generate(
@@ -1030,6 +1030,7 @@ class _HomePageState extends State {
dayData['selected'] == true &&
dayData['state'] != null) {
stateModule = dayData['state'];
+ currentTime = dayData['time'];
}
return SleepDateWidget(
mac: mac,
@@ -1053,9 +1054,13 @@ class _HomePageState extends State {
stateModule.isNotEmpty
? List.generate(
stateModule.length,
- (j) => SleepDataModuleWidget(
- data: stateModule[j],
- ),
+ (j) {
+ stateModule[j]['onto'] = true;
+ stateModule[j]['time'] = currentTime;
+ return SleepDataModuleWidget(
+ data: stateModule[j],
+ );
+ },
)
: [],
);
diff --git a/lib/pages/main_bottom/mine_page.dart b/lib/pages/main_bottom/mine_page.dart
index 916074d..5e0a95d 100644
--- a/lib/pages/main_bottom/mine_page.dart
+++ b/lib/pages/main_bottom/mine_page.dart
@@ -693,7 +693,7 @@ class _MinePageState extends State {
mainAxisSize: MainAxisSize.max,
children: [
Text(
- 'V1.0.2505.28',
+ 'V1.0.2505.29',
style:
FlutterFlowTheme.of(context)
.bodyMedium
diff --git a/lib/pages/sleep_report/chart/FatigueCircleIndicator.dart b/lib/pages/sleep_report/chart/FatigueCircleIndicator.dart
index 73778b5..b713d07 100644
--- a/lib/pages/sleep_report/chart/FatigueCircleIndicator.dart
+++ b/lib/pages/sleep_report/chart/FatigueCircleIndicator.dart
@@ -50,9 +50,7 @@ class FatigueCircleIndicator extends StatelessWidget {
'$percent%',
style: TextStyle(
fontSize: AppConstants().normal_text_fontSize,
- color: percent > 60
- ? themeController.currentColor.sc9
- : themeController.currentColor.sc3,
+ color: color,
),
),
SizedBox(height: 4.rpx),
@@ -60,9 +58,7 @@ class FatigueCircleIndicator extends StatelessWidget {
explain,
style: TextStyle(
fontSize: AppConstants().normal_text_fontSize,
- color: percent > 60
- ? themeController.currentColor.sc9
- : themeController.currentColor.sc3,
+ color: color,
),
),
],
diff --git a/lib/pages/sleep_report/chart/LineChartByRange.dart b/lib/pages/sleep_report/chart/LineChartByRange.dart
index 024e608..37ffa44 100644
--- a/lib/pages/sleep_report/chart/LineChartByRange.dart
+++ b/lib/pages/sleep_report/chart/LineChartByRange.dart
@@ -5,69 +5,517 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
import 'dart:ui' as ui;
import 'dart:math';
-class LineChartByRange extends StatelessWidget {
+//根据数据自定义
+// class LineChartByRange extends StatefulWidget {
+// final List