更新法语语言包
This commit is contained in:
@@ -646,5 +646,9 @@
|
|||||||
"开始": "startTime",
|
"开始": "startTime",
|
||||||
"结束": "endTime",
|
"结束": "endTime",
|
||||||
"时长": "duration:",
|
"时长": "duration:",
|
||||||
"请选择时区": "Please select a time zone"
|
"请选择时区": "Please select a time zone",
|
||||||
|
"邮箱登录": "Email Login",
|
||||||
|
"慢病管理": "Chronic Disease",
|
||||||
|
"请选择慢病": "Please select chronic disease",
|
||||||
|
"获得位置信息,连接附近的蓝牙设备": "Obtain location information, connect to nearby Bluetooth devices"
|
||||||
}
|
}
|
||||||
@@ -169,7 +169,6 @@
|
|||||||
"人": "人",
|
"人": "人",
|
||||||
"来自": "来自",
|
"来自": "来自",
|
||||||
"的分享": "的分享",
|
"的分享": "的分享",
|
||||||
"睡眠报告": "睡眠报告",
|
|
||||||
"未知类型设备": "未知类型设备",
|
"未知类型设备": "未知类型设备",
|
||||||
"SWES 智能床": "SWES 智能床",
|
"SWES 智能床": "SWES 智能床",
|
||||||
"SWES 智能床垫": "SWES 智能床垫",
|
"SWES 智能床垫": "SWES 智能床垫",
|
||||||
@@ -653,5 +652,9 @@
|
|||||||
"开始": "开始",
|
"开始": "开始",
|
||||||
"结束": "结束",
|
"结束": "结束",
|
||||||
"时长": "时长:",
|
"时长": "时长:",
|
||||||
"请选择时区": "请选择时区"
|
"请选择时区": "请选择时区",
|
||||||
|
"获得位置信息,连接附近的蓝牙设备": "获得位置信息,连接附近的蓝牙设备",
|
||||||
|
"慢病管理": "慢病管理",
|
||||||
|
"请选择慢病": "请选择慢病",
|
||||||
|
"邮箱登录": "邮箱登录"
|
||||||
}
|
}
|
||||||
@@ -646,5 +646,9 @@
|
|||||||
"开始": "開始",
|
"开始": "開始",
|
||||||
"结束": "結束",
|
"结束": "結束",
|
||||||
"时长": "時長:",
|
"时长": "時長:",
|
||||||
"请选择时区": "請選擇時區"
|
"请选择时区": "請選擇時區",
|
||||||
|
"邮箱登录": "郵箱登陸",
|
||||||
|
"慢病管理": "慢病管理",
|
||||||
|
"请选择慢病": "请选择慢病",
|
||||||
|
"获得位置信息,连接附近的蓝牙设备": "獲得位置信息,連接附近的藍牙設備"
|
||||||
}
|
}
|
||||||
Binary file not shown.
@@ -121,6 +121,19 @@ class CityModelController extends GetControllerEx<CityModel> {
|
|||||||
return jsonList.map((json) => CityModel.fromJson(json)).toList();
|
return jsonList.map((json) => CityModel.fromJson(json)).toList();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ef.log("_loadCityData 失败:$e");
|
ef.log("_loadCityData 失败:$e");
|
||||||
|
String currentLanguageCode = "en_US";
|
||||||
|
|
||||||
|
// 根据当前语言代码构建文件名
|
||||||
|
final String fileName = 'assets/city/city_$currentLanguageCode.json';
|
||||||
|
|
||||||
|
// 读取对应语言的JSON文件
|
||||||
|
final String jsonString = await rootBundle.loadString(fileName);
|
||||||
|
|
||||||
|
// 解析JSON数据并转换为 CityModel 列表
|
||||||
|
final List<dynamic> jsonList = jsonDecode(jsonString);
|
||||||
|
|
||||||
|
// 将 Map 转换为 CityModel
|
||||||
|
return jsonList.map((json) => CityModel.fromJson(json)).toList();
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ import 'package:ef/ef.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||||
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||||
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
|
import 'package:vbvs_app/enum/APPPackageType.dart';
|
||||||
import 'package:vbvs_app/model/api_response.dart';
|
import 'package:vbvs_app/model/api_response.dart';
|
||||||
|
|
||||||
part 'device_list_controller.g.dart';
|
part 'device_list_controller.g.dart';
|
||||||
@@ -46,6 +48,23 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
|
|||||||
String serviceName = ServiceConstant.server_service;
|
String serviceName = ServiceConstant.server_service;
|
||||||
String serviceApi = ServiceConstant.device_list;
|
String serviceApi = ServiceConstant.device_list;
|
||||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}$search";
|
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}$search";
|
||||||
|
String? language = "";
|
||||||
|
if (AppConstants().ent_type == APPPackageType.MHT.code) {
|
||||||
|
if (mhLanguageController.selectLanguage != null) {
|
||||||
|
language = mhLanguageController.selectLanguage.value!.language_code;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (languageController.selectLanguage != null) {
|
||||||
|
language = languageController.selectLanguage.value!.language_code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (language != null && language.isNotEmpty) {
|
||||||
|
if (queryUrl.contains("?")) {
|
||||||
|
queryUrl += "&lang=$language";
|
||||||
|
} else {
|
||||||
|
queryUrl += "?lang=$language";
|
||||||
|
}
|
||||||
|
}
|
||||||
var response = await EasyDartModule.dio.get(queryUrl);
|
var response = await EasyDartModule.dio.get(queryUrl);
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
var responseData =
|
var responseData =
|
||||||
@@ -80,6 +99,23 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
|
|||||||
String serviceApi = ServiceConstant.device_list;
|
String serviceApi = ServiceConstant.device_list;
|
||||||
String queryUrl =
|
String queryUrl =
|
||||||
"${serviceAddress}${serviceName}${serviceApi}?bindType=1&mac=$mac";
|
"${serviceAddress}${serviceName}${serviceApi}?bindType=1&mac=$mac";
|
||||||
|
String? language = "";
|
||||||
|
if (AppConstants().ent_type == APPPackageType.MHT.code) {
|
||||||
|
if (mhLanguageController.selectLanguage != null) {
|
||||||
|
language = mhLanguageController.selectLanguage.value!.language_code;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (languageController.selectLanguage != null) {
|
||||||
|
language = languageController.selectLanguage.value!.language_code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (language != null && language.isNotEmpty) {
|
||||||
|
if (queryUrl.contains("?")) {
|
||||||
|
queryUrl += "&lang=$language";
|
||||||
|
} else {
|
||||||
|
queryUrl += "?lang=$language";
|
||||||
|
}
|
||||||
|
}
|
||||||
var response = await EasyDartModule.dio.get(queryUrl);
|
var response = await EasyDartModule.dio.get(queryUrl);
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
var responseData =
|
var responseData =
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class MHLanguageController extends GetControllerEx<MHLanguageModel> {
|
|||||||
// 可选:添加默认语言(如英文)作为后备
|
// 可选:添加默认语言(如英文)作为后备
|
||||||
languageList.add(
|
languageList.add(
|
||||||
MHLanguageModel()
|
MHLanguageModel()
|
||||||
..filename = 'en-US.json'
|
..filename = 'en_US.json'
|
||||||
..language_name = 'English'
|
..language_name = 'English'
|
||||||
..selected = true, // 默认语言为选中状态
|
..selected = true, // 默认语言为选中状态
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class LanguageController extends GetControllerEx<LanguageModel> {
|
|||||||
// 可选:添加默认语言(如英文)作为后备
|
// 可选:添加默认语言(如英文)作为后备
|
||||||
languageList.add(
|
languageList.add(
|
||||||
LanguageModel()
|
LanguageModel()
|
||||||
..filename = 'en-US.json'
|
..filename = 'en_US.json'
|
||||||
..language_name = 'English'
|
..language_name = 'English'
|
||||||
..selected = true, // 默认语言为选中状态
|
..selected = true, // 默认语言为选中状态
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ enum APPPackageType {
|
|||||||
HUANSHUI(2, '欢睡'),
|
HUANSHUI(2, '欢睡'),
|
||||||
MHT(3, '眠花糖'),
|
MHT(3, '眠花糖'),
|
||||||
DONGHUA(4, '东华'),
|
DONGHUA(4, '东华'),
|
||||||
|
HAIER(5, '海尔'),
|
||||||
;
|
;
|
||||||
|
|
||||||
final int code;
|
final int code;
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ class AppLanguage extends Translations {
|
|||||||
Locale get currentLocale {
|
Locale get currentLocale {
|
||||||
// final parts = _currentLanguageCode.split('-');
|
// final parts = _currentLanguageCode.split('-');
|
||||||
// return Locale(parts[0], parts.length > 1 ? parts[1] : null);
|
// return Locale(parts[0], parts.length > 1 ? parts[1] : null);
|
||||||
return isChinese()? const Locale('zh', 'CN') : const Locale('en', 'US');
|
// return isChinese()? const Locale('zh', 'CN') : const Locale('en', 'US');
|
||||||
|
return Locale(_currentLanguageCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isChinese() {
|
bool isChinese() {
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ import 'package:vbvs_app/language/AppLanguage.dart';
|
|||||||
import 'package:vbvs_app/model/CustomThemeColor.dart';
|
import 'package:vbvs_app/model/CustomThemeColor.dart';
|
||||||
import 'package:vbvs_app/model/api_response.dart';
|
import 'package:vbvs_app/model/api_response.dart';
|
||||||
import 'package:vbvs_app/model/user_data.dart';
|
import 'package:vbvs_app/model/user_data.dart';
|
||||||
|
import 'package:vbvs_app/network/NetworkStatusController.dart';
|
||||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/MattressControl.dart';
|
import 'package:vbvs_app/pages/mh_page/MattressControl.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/device/component/mht_device_calibration_controller.dart';
|
import 'package:vbvs_app/pages/mh_page/device/component/mht_device_calibration_controller.dart';
|
||||||
@@ -867,6 +868,7 @@ class MyApp extends StatelessWidget {
|
|||||||
supportedLocales: [
|
supportedLocales: [
|
||||||
Locale('en', 'US'),
|
Locale('en', 'US'),
|
||||||
Locale('zh', 'CN'),
|
Locale('zh', 'CN'),
|
||||||
|
Locale('fr', 'FR'),
|
||||||
],
|
],
|
||||||
initialRoute: "/mianPageBottomChange",
|
initialRoute: "/mianPageBottomChange",
|
||||||
onGenerateRoute: mh_routers_themecontroller.mhonGenerateRoute,
|
onGenerateRoute: mh_routers_themecontroller.mhonGenerateRoute,
|
||||||
@@ -926,6 +928,7 @@ class MyApp extends StatelessWidget {
|
|||||||
Get.lazyPut(() => CommonMessageSettingController()),
|
Get.lazyPut(() => CommonMessageSettingController()),
|
||||||
Get.lazyPut(() => MHTDeviceUpgradeController()),
|
Get.lazyPut(() => MHTDeviceUpgradeController()),
|
||||||
Get.lazyPut(() => CityModelController()),
|
Get.lazyPut(() => CityModelController()),
|
||||||
|
Get.lazyPut(() => NetworkStatusController()),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ Future showDateSelectionDialog(BuildContext context,
|
|||||||
String title = "选择生日"}) {
|
String title = "选择生日"}) {
|
||||||
ThemeController themeController = Get.find();
|
ThemeController themeController = Get.find();
|
||||||
final bool isEn = Get.locale?.languageCode.startsWith('en') ?? false;
|
final bool isEn = Get.locale?.languageCode.startsWith('en') ?? false;
|
||||||
|
final bool isCn = Get.locale?.languageCode.startsWith('zh') ?? false;
|
||||||
Color checkColor = stringToColor("#D3B684");
|
Color checkColor = stringToColor("#D3B684");
|
||||||
|
|
||||||
final List<int> years = List.generate(100, (i) => DateTime.now().year - i)
|
final List<int> years = List.generate(100, (i) => DateTime.now().year - i)
|
||||||
@@ -380,7 +381,7 @@ Future showDateSelectionDialog(BuildContext context,
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 95.rpx),
|
padding: EdgeInsets.symmetric(horizontal: 95.rpx),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: isEn
|
children: !isCn
|
||||||
? [
|
? [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: getOnePickers(
|
child: getOnePickers(
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
|
import 'package:ef/ef.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class MessageTypeComponent extends StatelessWidget {
|
class MessageTypeComponent extends StatelessWidget {
|
||||||
final Map<String, dynamic> config;
|
final Map<String, dynamic> config;
|
||||||
|
|
||||||
const MessageTypeComponent({Key? key, required this.config}) : super(key: key);
|
const MessageTypeComponent({Key? key, required this.config})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -57,7 +59,8 @@ class MessageTypeComponent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0),
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _getTypeColor(type),
|
color: _getTypeColor(type),
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
@@ -79,10 +82,10 @@ class MessageTypeComponent extends StatelessWidget {
|
|||||||
// 构建数据列表
|
// 构建数据列表
|
||||||
Widget _buildDataList(List<dynamic> dataList) {
|
Widget _buildDataList(List<dynamic> dataList) {
|
||||||
if (dataList.isEmpty) {
|
if (dataList.isEmpty) {
|
||||||
return const Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.all(16.0),
|
padding: EdgeInsets.all(16.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'暂无数据',
|
'暂无数据'.tr,
|
||||||
style: TextStyle(color: Colors.grey),
|
style: TextStyle(color: Colors.grey),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -204,6 +204,10 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
height: 1,
|
height: 1,
|
||||||
color: Colors
|
color: Colors
|
||||||
.white),
|
.white),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow:
|
||||||
|
TextOverflow
|
||||||
|
.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -612,6 +616,10 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
height: 1,
|
height: 1,
|
||||||
color: Colors
|
color: Colors
|
||||||
.white),
|
.white),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow:
|
||||||
|
TextOverflow
|
||||||
|
.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1038,11 +1046,47 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// Flexible(
|
||||||
|
// child: Container(
|
||||||
|
// width: 300.rpx,
|
||||||
|
// height: 62.rpx,
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// borderRadius:
|
||||||
|
// BorderRadius
|
||||||
|
// .circular(50),
|
||||||
|
// border: Border.all(
|
||||||
|
// color: const Color(
|
||||||
|
// 0xFF9EA4B7),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// child: Align(
|
||||||
|
// alignment:
|
||||||
|
// const AlignmentDirectional(
|
||||||
|
// 0, 0),
|
||||||
|
// child: Text(
|
||||||
|
// '上传设备故障照片'.tr,
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontFamily:
|
||||||
|
// 'Readex Pro',
|
||||||
|
// color: const Color(
|
||||||
|
// 0xFF9EA4B7),
|
||||||
|
// fontSize: AppFontsize
|
||||||
|
// .normal_text_size,
|
||||||
|
// letterSpacing: 0,
|
||||||
|
// ),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow
|
||||||
|
// .ellipsis,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
Flexible(
|
Flexible(
|
||||||
|
child: IntrinsicWidth(
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 300.rpx,
|
|
||||||
height: 62.rpx,
|
height: 62.rpx,
|
||||||
decoration: BoxDecoration(
|
decoration:
|
||||||
|
BoxDecoration(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius
|
BorderRadius
|
||||||
.circular(50),
|
.circular(50),
|
||||||
@@ -1051,6 +1095,10 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
0xFF9EA4B7),
|
0xFF9EA4B7),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
padding: EdgeInsets
|
||||||
|
.symmetric(
|
||||||
|
horizontal:
|
||||||
|
30.rpx),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment:
|
||||||
const AlignmentDirectional(
|
const AlignmentDirectional(
|
||||||
@@ -1066,6 +1114,11 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
.normal_text_size,
|
.normal_text_size,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow
|
||||||
|
.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1319,7 +1372,8 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
fontSize: AppFontsize
|
fontSize: AppFontsize
|
||||||
.normal_text_size,
|
.normal_text_size,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
color: themeController.currentColor.sc4),
|
color: themeController
|
||||||
|
.currentColor.sc4),
|
||||||
enabledBorder:
|
enabledBorder:
|
||||||
UnderlineInputBorder(
|
UnderlineInputBorder(
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
@@ -1474,6 +1528,10 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
0,
|
0,
|
||||||
color: Colors
|
color: Colors
|
||||||
.white),
|
.white),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow
|
||||||
|
.ellipsis,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1525,7 +1583,9 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
'Readex Pro',
|
'Readex Pro',
|
||||||
letterSpacing:
|
letterSpacing:
|
||||||
0,
|
0,
|
||||||
color: themeController.currentColor.sc4,
|
color: themeController
|
||||||
|
.currentColor
|
||||||
|
.sc4,
|
||||||
),
|
),
|
||||||
enabledBorder:
|
enabledBorder:
|
||||||
UnderlineInputBorder(
|
UnderlineInputBorder(
|
||||||
@@ -1622,13 +1682,13 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
0.038,
|
0.038,
|
||||||
constraints:
|
constraints:
|
||||||
BoxConstraints(
|
BoxConstraints(
|
||||||
minWidth: 60.rpx,
|
minWidth: 60,
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Align(
|
||||||
mainAxisSize:
|
alignment:
|
||||||
MainAxisSize.max,
|
const AlignmentDirectional(
|
||||||
children: [
|
-1, 0),
|
||||||
Text(
|
child: Text(
|
||||||
'手机号码'.tr,
|
'手机号码'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
@@ -1637,10 +1697,14 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
26.rpx,
|
26.rpx,
|
||||||
letterSpacing:
|
letterSpacing:
|
||||||
0,
|
0,
|
||||||
|
height: 1,
|
||||||
color: Colors
|
color: Colors
|
||||||
.white),
|
.white),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow
|
||||||
|
.ellipsis,
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -1688,7 +1752,9 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
'Readex Pro',
|
'Readex Pro',
|
||||||
letterSpacing:
|
letterSpacing:
|
||||||
0,
|
0,
|
||||||
color: themeController.currentColor.sc4,
|
color: themeController
|
||||||
|
.currentColor
|
||||||
|
.sc4,
|
||||||
),
|
),
|
||||||
enabledBorder:
|
enabledBorder:
|
||||||
UnderlineInputBorder(
|
UnderlineInputBorder(
|
||||||
|
|||||||
@@ -248,6 +248,9 @@ class BookInfoPage extends GetView<BookInfoController> {
|
|||||||
? stringToColor(
|
? stringToColor(
|
||||||
'#D0D0D0')
|
'#D0D0D0')
|
||||||
: Colors.white),
|
: Colors.white),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"${device['bind'] == true ? "已被绑定" : "可绑定"}",
|
"${device['bind'] == true ? "已被绑定".tr : "可绑定".tr}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
color: device['bind'] == true
|
color: device['bind'] == true
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
|
|||||||
RxBool allSelect = false.obs; //升级是否全选
|
RxBool allSelect = false.obs; //升级是否全选
|
||||||
RxBool autoUpgrade = false.obs; //是否自动升级
|
RxBool autoUpgrade = false.obs; //是否自动升级
|
||||||
|
|
||||||
|
|
||||||
void startStatusPolling() {
|
void startStatusPolling() {
|
||||||
updateDeviceStatus().then((res) {
|
updateDeviceStatus().then((res) {
|
||||||
if (res.code == HttpStatusCodes.ok) {
|
if (res.code == HttpStatusCodes.ok) {
|
||||||
@@ -419,6 +418,28 @@ class MHTBlueToothController extends GetControllerEx<MHTBlueToothModel> {
|
|||||||
return result; // 在 requestWithLog 完成之后返回 result
|
return result; // 在 requestWithLog 完成之后返回 result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendCommand(Map commandData) async {
|
||||||
|
//todo 下发wifi指令
|
||||||
|
if (commandData == null || commandData.isEmpty) {
|
||||||
|
throw "指令数据不能为空";
|
||||||
|
}
|
||||||
|
//todo 填充蓝牙指令
|
||||||
|
String serviceAddress = ServiceConstant.service_address;
|
||||||
|
String serviceName = ServiceConstant.server_service;
|
||||||
|
String serviceApi = ServiceConstant.sendWifiCommand;
|
||||||
|
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||||
|
await requestWithLog(
|
||||||
|
logTitle: "下发wifi控制指令",
|
||||||
|
method: MyHttpMethod.post,
|
||||||
|
queryUrl: queryUrl,
|
||||||
|
onSuccess: (res) {
|
||||||
|
},
|
||||||
|
onFailure: (res) {
|
||||||
|
throw "下发wifi控制指令失败: ${res.msg}";
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//todo 解绑的时候删除自己所拥有的所有设备的睡眠习惯
|
//todo 解绑的时候删除自己所拥有的所有设备的睡眠习惯
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
|||||||
import 'package:vbvs_app/controller/person/person_controller.dart';
|
import 'package:vbvs_app/controller/person/person_controller.dart';
|
||||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/device/controller/mht_bluetooth_controller.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/device/model/BlueToothDataModel.dart';
|
import 'package:vbvs_app/pages/mh_page/device/model/BlueToothDataModel.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
||||||
|
|
||||||
@@ -245,9 +246,9 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
|
|||||||
Map editeData;
|
Map editeData;
|
||||||
BlueToothDataModel data =
|
BlueToothDataModel data =
|
||||||
blueteethBindController.shareDevice;
|
blueteethBindController.shareDevice;
|
||||||
|
|
||||||
editeData = {"mac".tr: data.mac};
|
editeData = {"mac".tr: data.mac};
|
||||||
Get.toNamed("/deviceSharePage", arguments: editeData);
|
Get.toNamed("/deviceSharePage", arguments: editeData);
|
||||||
|
|
||||||
},
|
},
|
||||||
colors: AppConstants().mhtButtongradientColors,
|
colors: AppConstants().mhtButtongradientColors,
|
||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
@@ -367,7 +368,6 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -502,7 +502,10 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Container(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxWidth: boxConstraints.maxWidth * 0.3),
|
||||||
|
child: Text(
|
||||||
'最小信号强度'.tr,
|
'最小信号强度'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
@@ -510,6 +513,9 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
|||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
|
|||||||
@@ -895,7 +895,9 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
|||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
flex: 1, // 左侧占1份权重(约33%)
|
||||||
|
child: Text(
|
||||||
'请选择城市'.tr,
|
'请选择城市'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
@@ -903,10 +905,18 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
|||||||
fontSize: 30.rpx,
|
fontSize: 30.rpx,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
Row(
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2, // 右侧占2份权重(约67%)
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment
|
||||||
|
.end, // 右侧内容右对齐
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Flexible(
|
||||||
|
child: Text(
|
||||||
cityModels[index].id != null
|
cityModels[index].id != null
|
||||||
? MyUtils
|
? MyUtils
|
||||||
.getDetailedCityDisplayText(
|
.getDetailedCityDisplayText(
|
||||||
@@ -914,12 +924,20 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
|||||||
: "请选择城市".tr,
|
: "请选择城市".tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color:
|
||||||
cityModels[index].id != null
|
cityModels[index].id !=
|
||||||
|
null
|
||||||
? Colors.white
|
? Colors.white
|
||||||
: themeController
|
: themeController
|
||||||
.currentColor.sc4,
|
.currentColor
|
||||||
|
.sc4,
|
||||||
fontSize: 30.rpx,
|
fontSize: 30.rpx,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow.ellipsis,
|
||||||
|
textAlign:
|
||||||
|
TextAlign.right, // 文本右对齐
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 16.rpx),
|
SizedBox(width: 16.rpx),
|
||||||
Icon(Icons.expand_more,
|
Icon(Icons.expand_more,
|
||||||
@@ -927,6 +945,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
|||||||
size: 48.rpx),
|
size: 48.rpx),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -973,7 +992,9 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
|||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
flex: 1, // 左侧占1份权重(约33%)
|
||||||
|
child: Text(
|
||||||
'请选择时区'.tr,
|
'请选择时区'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
@@ -981,44 +1002,59 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
|||||||
fontSize: 30.rpx,
|
fontSize: 30.rpx,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
Obx(() {
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2, // 右侧占2份权重(约67%)
|
||||||
|
child: Obx(() {
|
||||||
PeopleInfoController
|
PeopleInfoController
|
||||||
personController = Get.find();
|
personController = Get.find();
|
||||||
var aa =
|
var aa = personController
|
||||||
personController.timeZone.value;
|
.timeZone.value;
|
||||||
return Row(
|
return Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.end, // 右侧内容右对齐
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Flexible(
|
||||||
peopleList[index]['UTC'] ==
|
child: Text(
|
||||||
|
peopleList[index]
|
||||||
|
['UTC'] ==
|
||||||
null ||
|
null ||
|
||||||
peopleList[index]
|
peopleList[index]
|
||||||
['UTC'] ==
|
['UTC'] ==
|
||||||
""
|
""
|
||||||
? "请选择时区".tr
|
? "请选择时区".tr
|
||||||
: peopleList[index]['UTC'],
|
: peopleList[index]
|
||||||
|
['UTC'],
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: peopleList[index]
|
color: peopleList[index]
|
||||||
['UTC'] !=
|
['UTC'] !=
|
||||||
null
|
null
|
||||||
? Colors
|
? Colors.white
|
||||||
.white // 有时区时使用白色,保持和参考代码一致
|
|
||||||
: themeController
|
: themeController
|
||||||
.currentColor.sc4,
|
.currentColor
|
||||||
fontSize: 30
|
.sc4,
|
||||||
.rpx, // 使用固定的30.rpx,而不是AppConstants().title_text_fontSize
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign
|
||||||
|
.right, // 文本右对齐
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 16.rpx),
|
SizedBox(width: 16.rpx),
|
||||||
Icon(
|
Icon(
|
||||||
Icons.expand_more,
|
Icons.expand_more,
|
||||||
color: Colors
|
color: Colors.white,
|
||||||
.white, // 保持白色,和参考代码一致
|
|
||||||
size: 48.rpx,
|
size: 48.rpx,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
})
|
})),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1063,11 +1099,52 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisAlignment:
|
||||||
|
// MainAxisAlignment.spaceBetween,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// '慢病管理'.tr,
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontFamily: 'Readex Pro',
|
||||||
|
// color: Color(0xFF9EA4B7),
|
||||||
|
// fontSize: 30.rpx,
|
||||||
|
// letterSpacing: 0,
|
||||||
|
// ),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// getSelectedDiseaseNames(
|
||||||
|
// diseaseIdsList[index]),
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: diseaseIdsList[index]
|
||||||
|
// .isNotEmpty
|
||||||
|
// ? Colors.white
|
||||||
|
// : themeController
|
||||||
|
// .currentColor.sc4,
|
||||||
|
// fontSize: 30.rpx,
|
||||||
|
// ),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// SizedBox(width: 16.rpx),
|
||||||
|
// Icon(Icons.expand_more,
|
||||||
|
// color: Colors.white,
|
||||||
|
// size: 48.rpx),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
flex: 1, // 设置左侧最大宽度权重
|
||||||
|
child: Text(
|
||||||
'慢病管理'.tr,
|
'慢病管理'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
@@ -1075,10 +1152,18 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
|||||||
fontSize: 30.rpx,
|
fontSize: 30.rpx,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
Row(
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2, // 右侧内容占更多空间
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Flexible(
|
||||||
|
child: Text(
|
||||||
getSelectedDiseaseNames(
|
getSelectedDiseaseNames(
|
||||||
diseaseIdsList[index]),
|
diseaseIdsList[index]),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -1089,6 +1174,10 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
|||||||
.currentColor.sc4,
|
.currentColor.sc4,
|
||||||
fontSize: 30.rpx,
|
fontSize: 30.rpx,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 16.rpx),
|
SizedBox(width: 16.rpx),
|
||||||
Icon(Icons.expand_more,
|
Icon(Icons.expand_more,
|
||||||
@@ -1096,6 +1185,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
|||||||
size: 48.rpx),
|
size: 48.rpx),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
|||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
// _initController();
|
// _initController();
|
||||||
|
blueteethBindController.shareDevice = widget.deviceInfo;
|
||||||
await dealWifi(widget.deviceInfo.macA);
|
await dealWifi(widget.deviceInfo.macA);
|
||||||
print("object");
|
print("object");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
|||||||
getInfoRow(
|
getInfoRow(
|
||||||
context,
|
context,
|
||||||
"设备状态".tr,
|
"设备状态".tr,
|
||||||
"${data["status"]?["status"] == 1 ? "已绑定" : data["status"]?["status"] == 0 ? "已绑定" : "-"}",
|
"${data["status"]?["status"] == 1 ? "已绑定".tr : data["status"]?["status"] == 0 ? "已绑定".tr : "-"}",
|
||||||
),
|
),
|
||||||
getInfoRow(
|
getInfoRow(
|
||||||
context, "MAC", "${data["mac"] ?? "-"}"),
|
context, "MAC", "${data["mac"] ?? "-"}"),
|
||||||
@@ -211,7 +211,7 @@ class DevicePeopleInfo extends GetView<PeopleInfoController> {
|
|||||||
getInfoRow(context, "姓名".tr,
|
getInfoRow(context, "姓名".tr,
|
||||||
"${person["name"] ?? "-"}"),
|
"${person["name"] ?? "-"}"),
|
||||||
getInfoRow(context, "性别".tr,
|
getInfoRow(context, "性别".tr,
|
||||||
"${person["gender"] == null ? "-" : (person["gender"] == 1 ? "男" : "女")}"),
|
"${person["gender"] == null ? "-" : (person["gender"] == 1 ? "男".tr : "女".tr)}"),
|
||||||
getInfoRow(context, "身高".tr,
|
getInfoRow(context, "身高".tr,
|
||||||
"${person["height"] == null ? "-" : "${person["height"]}cm"}"),
|
"${person["height"] == null ? "-" : "${person["height"]}cm"}"),
|
||||||
getInfoRow(context, "体重".tr,
|
getInfoRow(context, "体重".tr,
|
||||||
|
|||||||
@@ -161,8 +161,8 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
|
|||||||
hintText: '请输入对方手机号/邮箱号'.tr,
|
hintText: '请输入对方手机号/邮箱号'.tr,
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
color: themeController
|
color:
|
||||||
.currentColor.sc4,
|
themeController.currentColor.sc4,
|
||||||
fontSize: 36.rpx,
|
fontSize: 36.rpx,
|
||||||
),
|
),
|
||||||
enabledBorder:
|
enabledBorder:
|
||||||
@@ -247,7 +247,8 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
|
|||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
'允许对方控制和查看该设备'.tr,
|
'允许对方控制和查看该设备'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
@@ -255,6 +256,9 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
|
|||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
double h = 33.rpx;
|
double h = 33.rpx;
|
||||||
@@ -313,7 +317,8 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
|
|||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
'仅允许对方查看该设备'.tr,
|
'仅允许对方查看该设备'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
@@ -321,6 +326,9 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
|
|||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
// ✅ 只包住响应式控件部分
|
// ✅ 只包住响应式控件部分
|
||||||
Obx(() {
|
Obx(() {
|
||||||
|
|||||||
@@ -271,96 +271,6 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
|
|||||||
return ApiResponse(code: -1, msg: "未知错误".tr); // Default return statement
|
return ApiResponse(code: -1, msg: "未知错误".tr); // Default return statement
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<ApiResponse> getSleepReport() async {
|
|
||||||
// try {
|
|
||||||
// sleepReportData.value = {};
|
|
||||||
// ApiResponse<Map<String, List<dynamic>>> apiResponse = ApiResponse(
|
|
||||||
// code: -1,
|
|
||||||
// msg: "请求失败".tr,
|
|
||||||
// );
|
|
||||||
|
|
||||||
// if (deviceList.value.isEmpty) {
|
|
||||||
// return ApiResponse(
|
|
||||||
// code: HttpStatusCodes.ok,
|
|
||||||
// msg: "请求成功".tr,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// String serviceAddress = ServiceConstant.service_address;
|
|
||||||
// String serviceName = ServiceConstant.server_service;
|
|
||||||
// String serviceApi = ServiceConstant.sleep_report;
|
|
||||||
|
|
||||||
// // for (var device in deviceList.value) {
|
|
||||||
// // String mac = device['mac'] ?? "";
|
|
||||||
// // if (mac.isEmpty) continue;
|
|
||||||
|
|
||||||
// // sleepReportData[mac] = []; // 初始化当前设备的数据列表
|
|
||||||
|
|
||||||
// // String queryUrl =
|
|
||||||
// // "$serviceAddress$serviceName$serviceApi?mac=$mac&time=${DateTime.now().millisecondsSinceEpoch}";
|
|
||||||
|
|
||||||
// // try {
|
|
||||||
// // String? language = "";
|
|
||||||
// // if (languageController.selectLanguage != null) {
|
|
||||||
// // language = languageController.selectLanguage.value!.language_code;
|
|
||||||
// // }
|
|
||||||
// // if (language != null && language.isNotEmpty) {
|
|
||||||
// // if (queryUrl.contains("?")) {
|
|
||||||
// // queryUrl += "&lang=$language";
|
|
||||||
// // } else {
|
|
||||||
// // queryUrl += "?lang=$language";
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// // var response = await EasyDartModule.dio.get(queryUrl);
|
|
||||||
// // if (response != null) {
|
|
||||||
// // var responseData = response.data is String
|
|
||||||
// // ? jsonDecode(response.data)
|
|
||||||
// // : response.data;
|
|
||||||
|
|
||||||
// // ApiResponse res =
|
|
||||||
// // ApiResponse.fromJson(responseData, (object) => object);
|
|
||||||
|
|
||||||
// // if (res.code == HttpStatusCodes.ok && res.data != null) {
|
|
||||||
// // // 确保数据是一个列表
|
|
||||||
// // if (res.data is List) {
|
|
||||||
// // sleepReportData[mac] = List.from(res.data);
|
|
||||||
// // } else {
|
|
||||||
// // sleepReportData[mac] = [res.data];
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// // } catch (e) {
|
|
||||||
// // EasyDartModule.logger.warning("请求设备 $mac 的睡眠数据失败: $e");
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// if (sleepReportData.value.isNotEmpty) {
|
|
||||||
// // 遍历 Map 中的每一个键值对
|
|
||||||
// sleepReportData.value.forEach((key, report) {
|
|
||||||
// // 确保 report 列表不为空
|
|
||||||
// if (report.isNotEmpty) {
|
|
||||||
// // 获取该列表的最后一个元素
|
|
||||||
// var lastElement = report.last;
|
|
||||||
|
|
||||||
// // 给最后一个元素添加 selected 属性
|
|
||||||
// lastElement['selected'] = true; // 假设每个元素是一个 Map 类型
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// updateAll();
|
|
||||||
|
|
||||||
// return ApiResponse(
|
|
||||||
// code: HttpStatusCodes.ok,
|
|
||||||
// msg: "请求成功".tr,
|
|
||||||
// data: sleepReportData,
|
|
||||||
// );
|
|
||||||
// } catch (e) {
|
|
||||||
// EasyDartModule.logger.info("设备请求列表异常: $e");
|
|
||||||
// DailyLogUtils.writeLog("设备请求列表异常: $e");
|
|
||||||
// return ApiResponse(code: -1, msg: "未知错误".tr, data: {});
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
updateDeviceShow(device) async {
|
updateDeviceShow(device) async {
|
||||||
try {
|
try {
|
||||||
ApiResponse apiResponse = ApiResponse(code: -1, msg: "操作失败".tr);
|
ApiResponse apiResponse = ApiResponse(code: -1, msg: "操作失败".tr);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import 'package:vbvs_app/controller/sleep/sleep_report_controller.dart';
|
|||||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
import 'package:vbvs_app/controller/weather/weather_controller.dart';
|
import 'package:vbvs_app/controller/weather/weather_controller.dart';
|
||||||
import 'package:vbvs_app/enum/APPPackageType.dart';
|
import 'package:vbvs_app/enum/APPPackageType.dart';
|
||||||
|
import 'package:vbvs_app/network/NetworkStatusController.dart';
|
||||||
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/FloatingSvgIcon.dart';
|
import 'package:vbvs_app/pages/mh_page/FloatingSvgIcon.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
||||||
@@ -45,6 +46,7 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
NetworkStatusController networkStatusController = Get.find();
|
||||||
if (userInfoController.model.login == 1) {
|
if (userInfoController.model.login == 1) {
|
||||||
//查询人员信息列表
|
//查询人员信息列表
|
||||||
deviceController.getPersonList();
|
deviceController.getPersonList();
|
||||||
@@ -567,29 +569,11 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (formFieldController
|
if (formFieldController
|
||||||
.value !=
|
.value !=
|
||||||
null) {
|
null) {
|
||||||
// Get.toNamed(
|
|
||||||
// "/newSleepReportPage",
|
|
||||||
// arguments: {
|
|
||||||
// 'mac':
|
|
||||||
// formFieldController
|
|
||||||
// .value!,
|
|
||||||
// 'type': 1,
|
|
||||||
// "person":
|
|
||||||
// personInfo.value,
|
|
||||||
// 'backgroundImg':
|
|
||||||
// 'assets/images/new_background.png',
|
|
||||||
// 'date': DateTime.now()
|
|
||||||
// .millisecondsSinceEpoch,
|
|
||||||
// 'person_show': false,
|
|
||||||
// 'reportPadding': false,
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
sleepReportController
|
sleepReportController
|
||||||
.initParams(
|
.initParams(
|
||||||
macValue:
|
macValue:
|
||||||
@@ -758,6 +742,10 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
color: stringToColor(
|
color: stringToColor(
|
||||||
"#FFFFFF"),
|
"#FFFFFF"),
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow
|
||||||
|
.ellipsis,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height:
|
height:
|
||||||
|
|||||||
@@ -1158,7 +1158,7 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
|||||||
newDiseaseIds;
|
newDiseaseIds;
|
||||||
controller.updateAll();
|
controller.updateAll();
|
||||||
},
|
},
|
||||||
title: "选择慢病".tr,
|
title: "请选择慢病".tr,
|
||||||
colors:
|
colors:
|
||||||
DiseaseSelectionColors(
|
DiseaseSelectionColors(
|
||||||
pickerBackgroundColor:
|
pickerBackgroundColor:
|
||||||
|
|||||||
@@ -340,6 +340,17 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
bridge.sdk.sendCommand((args) async {
|
||||||
|
ef.log('wifi控制指令: $args[0]');
|
||||||
|
try {
|
||||||
|
MHTBlueToothController blueToothController = Get.find();
|
||||||
|
// await blueToothController.saveHabitData(args[0]);
|
||||||
|
await blueToothController.sendCommand(args[0]);
|
||||||
|
} catch (e) {
|
||||||
|
ef.log("[wifi控制下发指令失败]:$e");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
ef.log('$e,$s');
|
ef.log('$e,$s');
|
||||||
|
|||||||
@@ -1022,6 +1022,10 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
letterSpacing:
|
letterSpacing:
|
||||||
0,
|
0,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow
|
||||||
|
.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1134,6 +1138,10 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
letterSpacing:
|
letterSpacing:
|
||||||
0,
|
0,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow
|
||||||
|
.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1992,7 +2000,10 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.start,
|
MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment
|
||||||
|
.start, // 改为顶部对齐
|
||||||
children: [
|
children: [
|
||||||
|
// 左边的选择框 - 保持不变
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment:
|
||||||
AlignmentDirectional(0, 0),
|
AlignmentDirectional(0, 0),
|
||||||
@@ -2040,22 +2051,14 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
.model
|
.model
|
||||||
.register_agree =
|
.register_agree =
|
||||||
newValue;
|
newValue;
|
||||||
|
|
||||||
controller
|
controller
|
||||||
.updateAll();
|
.updateAll();
|
||||||
registerController
|
registerController
|
||||||
.updateAll();
|
.updateAll();
|
||||||
// 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取
|
|
||||||
// if (newValue ==
|
|
||||||
// true) {
|
|
||||||
// Deviceconfig
|
|
||||||
// .initPlatformState();
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
width: 1.5,
|
width: 1.5,
|
||||||
color:
|
color: Colors.white,
|
||||||
Colors.white,
|
|
||||||
),
|
),
|
||||||
activeColor:
|
activeColor:
|
||||||
stringToColor(
|
stringToColor(
|
||||||
@@ -2064,122 +2067,79 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
stringToColor(
|
stringToColor(
|
||||||
"#011D33"),
|
"#011D33"),
|
||||||
),
|
),
|
||||||
)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Flexible(
|
),
|
||||||
child: Padding(
|
),
|
||||||
padding: EdgeInsetsDirectional
|
|
||||||
.fromSTEB(0, 0, 0, 0),
|
// 右边的文字部分 - 修改这里
|
||||||
|
SizedBox(width: 8), // 添加一些间距
|
||||||
|
Expanded(
|
||||||
|
// 使用 Expanded 而不是 Flexible
|
||||||
child: Container(
|
child: Container(
|
||||||
width:
|
|
||||||
MediaQuery.sizeOf(context)
|
|
||||||
.width *
|
|
||||||
0.622,
|
|
||||||
height:
|
|
||||||
MediaQuery.sizeOf(context)
|
|
||||||
.height *
|
|
||||||
1,
|
|
||||||
constraints: BoxConstraints(
|
|
||||||
minWidth: 466,
|
|
||||||
minHeight: 30,
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(),
|
decoration: BoxDecoration(),
|
||||||
child: Container(
|
child: Wrap(
|
||||||
width: 100,
|
// 使用 Wrap 替代 Row,实现自动换行
|
||||||
height: 100,
|
spacing: 0, // 文字之间的水平间距
|
||||||
decoration: BoxDecoration(),
|
runSpacing: 0, // 行之间的垂直间距
|
||||||
child: Row(
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.max,
|
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Text(
|
||||||
alignment:
|
|
||||||
AlignmentDirectional(
|
|
||||||
0, 0),
|
|
||||||
child: Text(
|
|
||||||
'我已阅读并同意'.tr,
|
'我已阅读并同意'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
'Readex Pro',
|
'Readex Pro',
|
||||||
color:
|
color: Colors.white,
|
||||||
Colors.white,
|
|
||||||
fontSize: 23.rpx,
|
fontSize: 23.rpx,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
InkWell(
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
AlignmentDirectional(
|
|
||||||
0, 0),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
"/userPolicyPageNew",
|
"/userPolicyPageNew",
|
||||||
arguments:
|
arguments:
|
||||||
getPrivacy(
|
getPrivacy(2));
|
||||||
2));
|
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'《用户协议》'.tr,
|
'《用户协议》'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
'Readex Pro',
|
'Readex Pro',
|
||||||
color:
|
color: stringToColor(
|
||||||
stringToColor(
|
|
||||||
"FF9F66"),
|
"FF9F66"),
|
||||||
fontSize:
|
|
||||||
23.rpx,
|
|
||||||
letterSpacing:
|
|
||||||
0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
AlignmentDirectional(
|
|
||||||
0, 0),
|
|
||||||
child: Text(
|
|
||||||
'与'.tr,
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily:
|
|
||||||
'Readex Pro',
|
|
||||||
color:
|
|
||||||
Colors.white,
|
|
||||||
fontSize: 23.rpx,
|
fontSize: 23.rpx,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Text(
|
||||||
alignment:
|
'与'.tr,
|
||||||
AlignmentDirectional(
|
style: TextStyle(
|
||||||
0, 0),
|
fontFamily:
|
||||||
child: InkWell(
|
'Readex Pro',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 23.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
"/privacyPolicyPageNew",
|
"/privacyPolicyPageNew",
|
||||||
arguments:
|
arguments:
|
||||||
getPrivacy(
|
getPrivacy(1));
|
||||||
1));
|
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'《隐私协议》'.tr,
|
'《隐私协议》'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
'Readex Pro',
|
'Readex Pro',
|
||||||
color:
|
color: stringToColor(
|
||||||
stringToColor(
|
|
||||||
"FF9F66"),
|
"FF9F66"),
|
||||||
fontSize:
|
fontSize: 23.rpx,
|
||||||
23.rpx,
|
letterSpacing: 0,
|
||||||
letterSpacing:
|
|
||||||
0,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -2187,11 +2147,10 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
@@ -2229,7 +2188,7 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
.fromSTEB(
|
.fromSTEB(
|
||||||
0, 0, 0, 0),
|
0, 0, 0, 0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 36,
|
width: 44,
|
||||||
height: 36,
|
height: 36,
|
||||||
decoration:
|
decoration:
|
||||||
BoxDecoration(),
|
BoxDecoration(),
|
||||||
@@ -2247,35 +2206,18 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
context)
|
context)
|
||||||
.width *
|
.width *
|
||||||
0.622,
|
0.622,
|
||||||
height: MediaQuery.sizeOf(
|
|
||||||
context)
|
|
||||||
.height *
|
|
||||||
1,
|
|
||||||
// constraints:
|
|
||||||
// BoxConstraints(
|
|
||||||
// minWidth: 466,
|
|
||||||
// minHeight: 30,
|
|
||||||
// ),
|
|
||||||
decoration:
|
decoration:
|
||||||
BoxDecoration(),
|
BoxDecoration(),
|
||||||
child: Container(
|
child: Container(
|
||||||
// width: 100,
|
|
||||||
// height: 100,
|
|
||||||
decoration:
|
decoration:
|
||||||
BoxDecoration(),
|
BoxDecoration(),
|
||||||
child: Row(
|
child: Wrap(
|
||||||
mainAxisSize:
|
// 将 Row 改为 Wrap,实现自动换行
|
||||||
MainAxisSize.max,
|
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Text(
|
||||||
alignment:
|
|
||||||
AlignmentDirectional(
|
|
||||||
0, 0),
|
|
||||||
child: Text(
|
|
||||||
'注:首次登录会自动创建账号'
|
'注:首次登录会自动创建账号'
|
||||||
.tr,
|
.tr,
|
||||||
style:
|
style: TextStyle(
|
||||||
TextStyle(
|
|
||||||
fontFamily:
|
fontFamily:
|
||||||
'Readex Pro',
|
'Readex Pro',
|
||||||
color: stringToColor(
|
color: stringToColor(
|
||||||
@@ -2286,7 +2228,6 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
0,
|
0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -2371,17 +2312,17 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
child: Text.rich(
|
child: Text.rich(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
// TextSpan(
|
||||||
text: "还没有账号?".tr,
|
// text: "还没有账号?".tr,
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
color: Colors
|
// color: Colors
|
||||||
.white, // 设置"还没有账号?"为白色
|
// .white, // 设置"还没有账号?"为白色
|
||||||
fontFamily:
|
// fontFamily:
|
||||||
'Readex Pro',
|
// 'Readex Pro',
|
||||||
fontSize: AppFontsize
|
// fontSize: AppFontsize
|
||||||
.small_text_size,
|
// .small_text_size,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: '前往注册'.tr,
|
text: '前往注册'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@@ -826,11 +826,206 @@ class RegisterPage extends GetView<MHTRegisterController> {
|
|||||||
minHeight: 30,
|
minHeight: 30,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(),
|
decoration: BoxDecoration(),
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
// mainAxisAlignment:
|
||||||
|
// MainAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// Align(
|
||||||
|
// alignment:
|
||||||
|
// AlignmentDirectional(0, 0),
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsetsDirectional
|
||||||
|
// .fromSTEB(0, 3, 0, 0),
|
||||||
|
// child: Container(
|
||||||
|
// width: 36,
|
||||||
|
// height: 36,
|
||||||
|
// decoration: BoxDecoration(),
|
||||||
|
// child: Align(
|
||||||
|
// alignment:
|
||||||
|
// AlignmentDirectional(
|
||||||
|
// 0, 0),
|
||||||
|
// child: Theme(
|
||||||
|
// data: ThemeData(
|
||||||
|
// checkboxTheme:
|
||||||
|
// CheckboxThemeData(
|
||||||
|
// visualDensity:
|
||||||
|
// VisualDensity
|
||||||
|
// .compact,
|
||||||
|
// materialTapTargetSize:
|
||||||
|
// MaterialTapTargetSize
|
||||||
|
// .shrinkWrap,
|
||||||
|
// shape:
|
||||||
|
// RoundedRectangleBorder(
|
||||||
|
// borderRadius:
|
||||||
|
// BorderRadius
|
||||||
|
// .circular(
|
||||||
|
// 64),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// unselectedWidgetColor:
|
||||||
|
// Color(0xFFD3D3D3),
|
||||||
|
// ),
|
||||||
|
// child: Obx(
|
||||||
|
// () => Checkbox(
|
||||||
|
// value: controller
|
||||||
|
// .model
|
||||||
|
// .register_agree ??
|
||||||
|
// false,
|
||||||
|
// onChanged:
|
||||||
|
// (newValue) async {
|
||||||
|
// controller.model
|
||||||
|
// .register_agree =
|
||||||
|
// newValue;
|
||||||
|
|
||||||
|
// controller
|
||||||
|
// .updateAll();
|
||||||
|
// },
|
||||||
|
// side: BorderSide(
|
||||||
|
// width: 1.5,
|
||||||
|
// color: Colors.white,
|
||||||
|
// ),
|
||||||
|
// activeColor:
|
||||||
|
// const Color(
|
||||||
|
// 0xFF84F5FF),
|
||||||
|
// checkColor:
|
||||||
|
// Color(0xFF003058),
|
||||||
|
// visualDensity:
|
||||||
|
// VisualDensity(
|
||||||
|
// horizontal:
|
||||||
|
// -4.0,
|
||||||
|
// vertical:
|
||||||
|
// -4.0),
|
||||||
|
// ),
|
||||||
|
// )),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Flexible(
|
||||||
|
// child: Padding(
|
||||||
|
// padding: EdgeInsetsDirectional
|
||||||
|
// .fromSTEB(0, 0, 0, 0),
|
||||||
|
// child: Container(
|
||||||
|
// width:
|
||||||
|
// MediaQuery.sizeOf(context)
|
||||||
|
// .width *
|
||||||
|
// 0.622,
|
||||||
|
// height:
|
||||||
|
// MediaQuery.sizeOf(context)
|
||||||
|
// .height *
|
||||||
|
// 1,
|
||||||
|
// constraints: BoxConstraints(
|
||||||
|
// minWidth: 466,
|
||||||
|
// minHeight: 30,
|
||||||
|
// ),
|
||||||
|
// decoration: BoxDecoration(),
|
||||||
|
// child: Container(
|
||||||
|
// width: 100,
|
||||||
|
// height: 100,
|
||||||
|
// decoration: BoxDecoration(),
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisSize:
|
||||||
|
// MainAxisSize.max,
|
||||||
|
// children: [
|
||||||
|
// Align(
|
||||||
|
// alignment:
|
||||||
|
// AlignmentDirectional(
|
||||||
|
// 0, 0),
|
||||||
|
// child: Text(
|
||||||
|
// '我已阅读并同意'.tr,
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontFamily:
|
||||||
|
// 'Readex Pro',
|
||||||
|
// color: Colors.white,
|
||||||
|
// fontSize: 12,
|
||||||
|
// letterSpacing: 0,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Align(
|
||||||
|
// alignment:
|
||||||
|
// AlignmentDirectional(
|
||||||
|
// 0, 0),
|
||||||
|
// child: InkWell(
|
||||||
|
// onTap: () {
|
||||||
|
// Get.toNamed(
|
||||||
|
// "/userPolicyPageNew",
|
||||||
|
// arguments:
|
||||||
|
// getPrivacy(
|
||||||
|
// 2));
|
||||||
|
// },
|
||||||
|
// child: Text(
|
||||||
|
// '《用户协议》'.tr,
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontFamily:
|
||||||
|
// 'Readex Pro',
|
||||||
|
// color:
|
||||||
|
// stringToColor(
|
||||||
|
// "FF9F66"),
|
||||||
|
// fontSize: 12,
|
||||||
|
// letterSpacing: 0,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Align(
|
||||||
|
// alignment:
|
||||||
|
// AlignmentDirectional(
|
||||||
|
// 0, 0),
|
||||||
|
// child: Text(
|
||||||
|
// '与'.tr,
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontFamily:
|
||||||
|
// 'Readex Pro',
|
||||||
|
// color: Colors.white,
|
||||||
|
// fontSize: 12,
|
||||||
|
// letterSpacing: 0,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Align(
|
||||||
|
// alignment:
|
||||||
|
// AlignmentDirectional(
|
||||||
|
// 0, 0),
|
||||||
|
// child: InkWell(
|
||||||
|
// onTap: () {
|
||||||
|
// Get.toNamed(
|
||||||
|
// "/privacyPolicyPageNew",
|
||||||
|
// arguments:
|
||||||
|
// getPrivacy(
|
||||||
|
// 1));
|
||||||
|
// },
|
||||||
|
// child: Text(
|
||||||
|
// '《隐私协议》'.tr,
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontFamily:
|
||||||
|
// 'Readex Pro',
|
||||||
|
// color:
|
||||||
|
// stringToColor(
|
||||||
|
// "FF9F66"),
|
||||||
|
// fontSize: 12,
|
||||||
|
// letterSpacing: 0,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.start,
|
MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment
|
||||||
|
.start, // 添加这个,让文字与选择框顶部对齐
|
||||||
children: [
|
children: [
|
||||||
|
// 左边的选择框 - 保持不变
|
||||||
Align(
|
Align(
|
||||||
alignment:
|
alignment:
|
||||||
AlignmentDirectional(0, 0),
|
AlignmentDirectional(0, 0),
|
||||||
@@ -859,8 +1054,7 @@ class RegisterPage extends GetView<MHTRegisterController> {
|
|||||||
RoundedRectangleBorder(
|
RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius
|
BorderRadius
|
||||||
.circular(
|
.circular(64),
|
||||||
64),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
unselectedWidgetColor:
|
unselectedWidgetColor:
|
||||||
@@ -868,8 +1062,7 @@ class RegisterPage extends GetView<MHTRegisterController> {
|
|||||||
),
|
),
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() => Checkbox(
|
() => Checkbox(
|
||||||
value: controller
|
value: controller.model
|
||||||
.model
|
|
||||||
.register_agree ??
|
.register_agree ??
|
||||||
false,
|
false,
|
||||||
onChanged:
|
onChanged:
|
||||||
@@ -877,7 +1070,6 @@ class RegisterPage extends GetView<MHTRegisterController> {
|
|||||||
controller.model
|
controller.model
|
||||||
.register_agree =
|
.register_agree =
|
||||||
newValue;
|
newValue;
|
||||||
|
|
||||||
controller
|
controller
|
||||||
.updateAll();
|
.updateAll();
|
||||||
},
|
},
|
||||||
@@ -892,130 +1084,93 @@ class RegisterPage extends GetView<MHTRegisterController> {
|
|||||||
Color(0xFF003058),
|
Color(0xFF003058),
|
||||||
visualDensity:
|
visualDensity:
|
||||||
VisualDensity(
|
VisualDensity(
|
||||||
horizontal:
|
horizontal: -4.0,
|
||||||
-4.0,
|
vertical: -4.0,
|
||||||
vertical:
|
|
||||||
-4.0),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Flexible(
|
),
|
||||||
child: Padding(
|
),
|
||||||
padding: EdgeInsetsDirectional
|
),
|
||||||
.fromSTEB(0, 0, 0, 0),
|
),
|
||||||
|
SizedBox(width: 8), // 添加间距
|
||||||
|
|
||||||
|
// 右边的文字部分 - 修改这里
|
||||||
|
Expanded(
|
||||||
|
// 使用 Expanded 替代 Flexible
|
||||||
child: Container(
|
child: Container(
|
||||||
width:
|
|
||||||
MediaQuery.sizeOf(context)
|
|
||||||
.width *
|
|
||||||
0.622,
|
|
||||||
height:
|
|
||||||
MediaQuery.sizeOf(context)
|
|
||||||
.height *
|
|
||||||
1,
|
|
||||||
constraints: BoxConstraints(
|
|
||||||
minWidth: 466,
|
|
||||||
minHeight: 30,
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(),
|
decoration: BoxDecoration(),
|
||||||
child: Container(
|
child: Wrap(
|
||||||
width: 100,
|
// 将 Row 改为 Wrap,实现自动换行
|
||||||
height: 100,
|
spacing: 4, // 文字之间的水平间距
|
||||||
decoration: BoxDecoration(),
|
runSpacing: 0, // 行之间的垂直间距
|
||||||
child: Row(
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment:
|
alignment:
|
||||||
AlignmentDirectional(
|
WrapAlignment.start, // 左对齐
|
||||||
0, 0),
|
crossAxisAlignment:
|
||||||
child: Text(
|
WrapCrossAlignment
|
||||||
|
.center, // 垂直居中
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
'我已阅读并同意'.tr,
|
'我已阅读并同意'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily: 'Readex Pro',
|
||||||
'Readex Pro',
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
InkWell(
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
AlignmentDirectional(
|
|
||||||
0, 0),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
"/userPolicyPageNew",
|
"/userPolicyPageNew",
|
||||||
arguments:
|
arguments:
|
||||||
getPrivacy(
|
getPrivacy(2));
|
||||||
2));
|
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'《用户协议》'.tr,
|
'《用户协议》'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
'Readex Pro',
|
'Readex Pro',
|
||||||
color:
|
color: stringToColor(
|
||||||
stringToColor(
|
|
||||||
"FF9F66"),
|
"FF9F66"),
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Text(
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
AlignmentDirectional(
|
|
||||||
0, 0),
|
|
||||||
child: Text(
|
|
||||||
'与'.tr,
|
'与'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily: 'Readex Pro',
|
||||||
'Readex Pro',
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
InkWell(
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
AlignmentDirectional(
|
|
||||||
0, 0),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
"/privacyPolicyPageNew",
|
"/privacyPolicyPageNew",
|
||||||
arguments:
|
arguments:
|
||||||
getPrivacy(
|
getPrivacy(1));
|
||||||
1));
|
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'《隐私协议》'.tr,
|
'《隐私协议》'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
'Readex Pro',
|
'Readex Pro',
|
||||||
color:
|
color: stringToColor(
|
||||||
stringToColor(
|
|
||||||
"FF9F66"),
|
"FF9F66"),
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -125,8 +125,11 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Flexible(
|
||||||
constraints: BoxConstraints(
|
flex: 1,
|
||||||
|
child: Container(
|
||||||
|
constraints:
|
||||||
|
BoxConstraints(
|
||||||
minWidth: 158
|
minWidth: 158
|
||||||
.rpx, // 设置最小宽度为 100
|
.rpx, // 设置最小宽度为 100
|
||||||
),
|
),
|
||||||
@@ -144,10 +147,15 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
|
|||||||
.normal_text_size,
|
.normal_text_size,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow
|
||||||
|
.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
|
flex: 2,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: MediaQuery.sizeOf(
|
width: MediaQuery.sizeOf(
|
||||||
context)
|
context)
|
||||||
@@ -264,8 +272,11 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Flexible(
|
||||||
constraints: BoxConstraints(
|
flex: 1,
|
||||||
|
child: Container(
|
||||||
|
constraints:
|
||||||
|
BoxConstraints(
|
||||||
minWidth: 158
|
minWidth: 158
|
||||||
.rpx, // 设置最小宽度为 100
|
.rpx, // 设置最小宽度为 100
|
||||||
),
|
),
|
||||||
@@ -283,10 +294,15 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
|
|||||||
.normal_text_size,
|
.normal_text_size,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow
|
||||||
|
.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
|
flex: 2,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: MediaQuery.sizeOf(
|
width: MediaQuery.sizeOf(
|
||||||
context)
|
context)
|
||||||
@@ -483,6 +499,10 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
|
|||||||
letterSpacing:
|
letterSpacing:
|
||||||
0,
|
0,
|
||||||
),
|
),
|
||||||
|
maxLines:
|
||||||
|
1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
@@ -500,11 +520,13 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Flexible(
|
||||||
|
flex: 1,
|
||||||
|
child: Container(
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
minWidth: 158.rpx,
|
minWidth: 158.rpx,
|
||||||
maxWidth:
|
// maxWidth: 158
|
||||||
158.rpx // 设置最小宽度为 100
|
// .rpx // 设置最小宽度为 100
|
||||||
),
|
),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment:
|
||||||
@@ -520,10 +542,15 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
|
|||||||
.normal_text_size,
|
.normal_text_size,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow
|
||||||
|
.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
|
flex: 2,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: MediaQuery.sizeOf(
|
width: MediaQuery.sizeOf(
|
||||||
context)
|
context)
|
||||||
@@ -665,11 +692,13 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Flexible(
|
||||||
|
flex: 1,
|
||||||
|
child: Container(
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
minWidth: 158.rpx,
|
minWidth: 158.rpx,
|
||||||
maxWidth:
|
// maxWidth: 158
|
||||||
158.rpx // 设置最小宽度为 100
|
// .rpx // 设置最小宽度为 100
|
||||||
),
|
),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment:
|
||||||
@@ -686,10 +715,14 @@ class UpdatePasswordPage extends GetView<UpdatePasswordController> {
|
|||||||
.normal_text_size,
|
.normal_text_size,
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
|
overflow: TextOverflow
|
||||||
|
.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
|
flex: 2,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: MediaQuery.sizeOf(
|
width: MediaQuery.sizeOf(
|
||||||
context)
|
context)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ void showDiseaseSelectionDialog(
|
|||||||
required List<String> selectedIds,
|
required List<String> selectedIds,
|
||||||
required List diseaseList,
|
required List diseaseList,
|
||||||
Function(List<String>)? onDiseasesChanged,
|
Function(List<String>)? onDiseasesChanged,
|
||||||
String title = "选择慢病",
|
String title = "请选择慢病",
|
||||||
DiseaseSelectionColors? colors,
|
DiseaseSelectionColors? colors,
|
||||||
}) {
|
}) {
|
||||||
ThemeController themeController = Get.find();
|
ThemeController themeController = Get.find();
|
||||||
@@ -24,7 +24,7 @@ void showDiseaseSelectionDialog(
|
|||||||
colors?.selectedDiseaseColor ?? themeController.currentColor.sc2;
|
colors?.selectedDiseaseColor ?? themeController.currentColor.sc2;
|
||||||
|
|
||||||
final RxList<String> selectedDiseaseIds = selectedIds.obs;
|
final RxList<String> selectedDiseaseIds = selectedIds.obs;
|
||||||
|
title = title.tr;
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
|||||||
@@ -1,361 +1,3 @@
|
|||||||
// import 'dart:math';
|
|
||||||
// import 'dart:ui' as ui;
|
|
||||||
|
|
||||||
// import 'package:ef/ef.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:intl/intl.dart';
|
|
||||||
// import 'package:vbvs_app/common/util/FitTool.dart';
|
|
||||||
// import 'package:vbvs_app/common/util/MyUtils.dart';
|
|
||||||
|
|
||||||
// class LineChartByRange extends StatefulWidget {
|
|
||||||
// final List<Map<String, dynamic>> showLabel;
|
|
||||||
// final int startTime;
|
|
||||||
// final int endTime;
|
|
||||||
// final int? threshold;
|
|
||||||
|
|
||||||
// /// 新增外部指定的 Y 轴最大值
|
|
||||||
// final int maxY;
|
|
||||||
|
|
||||||
// /// Y 轴分段数,默认6段
|
|
||||||
// final int ySegments;
|
|
||||||
|
|
||||||
// const LineChartByRange({
|
|
||||||
// Key? key,
|
|
||||||
// required this.showLabel,
|
|
||||||
// required this.startTime,
|
|
||||||
// required this.endTime,
|
|
||||||
// required this.maxY,
|
|
||||||
// this.threshold,
|
|
||||||
// this.ySegments = 6,
|
|
||||||
// }) : super(key: key);
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// State<LineChartByRange> createState() => _LineChartByRangeState();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// class _LineChartByRangeState extends State<LineChartByRange> {
|
|
||||||
// Offset? selectedOffset;
|
|
||||||
// Map<String, dynamic>? selectedData;
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// if (widget.showLabel.isEmpty) return const SizedBox();
|
|
||||||
|
|
||||||
// DateTime minTime = DateTime.fromMillisecondsSinceEpoch(widget.startTime);
|
|
||||||
// DateTime maxTime = DateTime.fromMillisecondsSinceEpoch(widget.endTime);
|
|
||||||
|
|
||||||
// return GestureDetector(
|
|
||||||
// onTapDown: (details) {
|
|
||||||
// RenderBox box = context.findRenderObject() as RenderBox;
|
|
||||||
// final localPosition = box.globalToLocal(details.globalPosition);
|
|
||||||
|
|
||||||
// // 查找是否点击到某个点
|
|
||||||
// for (var item in widget.showLabel) {
|
|
||||||
// int start = item['startTime'];
|
|
||||||
// int end = item['endTime'];
|
|
||||||
// int times = item['times'];
|
|
||||||
|
|
||||||
// double chartWidth = box.size.width - 40.rpx; // 与 painter 内一致处理
|
|
||||||
// double chartHeight = box.size.height - 30.rpx;
|
|
||||||
// double xStart = 20.rpx + 12.rpx;
|
|
||||||
|
|
||||||
// int totalDuration =
|
|
||||||
// maxTime.millisecondsSinceEpoch - minTime.millisecondsSinceEpoch;
|
|
||||||
|
|
||||||
// double startX = xStart +
|
|
||||||
// chartWidth *
|
|
||||||
// (start - minTime.millisecondsSinceEpoch) /
|
|
||||||
// totalDuration;
|
|
||||||
// double y = chartHeight * (1 - times / widget.maxY);
|
|
||||||
|
|
||||||
// // 判断点击范围(圆点半径±6.rpx范围)
|
|
||||||
// if ((localPosition - Offset(startX, y)).distance < 10.rpx) {
|
|
||||||
// setState(() {
|
|
||||||
// selectedOffset = Offset(startX, y);
|
|
||||||
// selectedData = item;
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// double endX = xStart +
|
|
||||||
// chartWidth *
|
|
||||||
// (end - minTime.millisecondsSinceEpoch) /
|
|
||||||
// totalDuration;
|
|
||||||
// if ((localPosition - Offset(endX, y)).distance < 10.rpx) {
|
|
||||||
// setState(() {
|
|
||||||
// selectedOffset = Offset(endX, y);
|
|
||||||
// selectedData = item;
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 没点到,清除选中
|
|
||||||
// setState(() {
|
|
||||||
// selectedOffset = null;
|
|
||||||
// selectedData = null;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// child: Stack(
|
|
||||||
// children: [
|
|
||||||
// SizedBox(
|
|
||||||
// height: 500.rpx,
|
|
||||||
// child: CustomPaint(
|
|
||||||
// size: Size(double.infinity, 500.rpx),
|
|
||||||
// painter: _LineChartByRangePainter(
|
|
||||||
// data: widget.showLabel,
|
|
||||||
// maxY: widget.maxY,
|
|
||||||
// minTime: minTime,
|
|
||||||
// maxTime: maxTime,
|
|
||||||
// threshold: widget.threshold,
|
|
||||||
// ySegments: widget.ySegments,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// if (selectedOffset != null && selectedData != null)
|
|
||||||
// Positioned(
|
|
||||||
// left: selectedOffset!.dx - 60.rpx,
|
|
||||||
// top: selectedOffset!.dy - 50.rpx,
|
|
||||||
// child: Container(
|
|
||||||
// padding:
|
|
||||||
// EdgeInsets.symmetric(horizontal: 12.rpx, vertical: 8.rpx),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Colors.black.withOpacity(0.3),
|
|
||||||
// borderRadius: BorderRadius.circular(10.rpx),
|
|
||||||
// ),
|
|
||||||
// child: Text(
|
|
||||||
// '${DateFormat('HH:mm').format(DateTime.fromMillisecondsSinceEpoch(selectedData!['startTime']))} - '
|
|
||||||
// '${DateFormat('HH:mm').format(DateTime.fromMillisecondsSinceEpoch(selectedData!['endTime']))}\n'
|
|
||||||
// "时长"
|
|
||||||
// .tr +
|
|
||||||
// ' ${selectedData!['times']}',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 18.rpx,
|
|
||||||
// color: Colors.white,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// class _LineChartByRangePainter extends CustomPainter {
|
|
||||||
// final List<Map<String, dynamic>> data;
|
|
||||||
// final int maxY;
|
|
||||||
// final DateTime minTime;
|
|
||||||
// final DateTime maxTime;
|
|
||||||
// final int? threshold;
|
|
||||||
// final int ySegments;
|
|
||||||
|
|
||||||
// _LineChartByRangePainter({
|
|
||||||
// required this.data,
|
|
||||||
// required this.maxY,
|
|
||||||
// required this.minTime,
|
|
||||||
// required this.maxTime,
|
|
||||||
// this.threshold,
|
|
||||||
// this.ySegments = 6,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// void paint(Canvas canvas, Size size) {
|
|
||||||
// double padding = 20.rpx;
|
|
||||||
// double labelInset = 12.rpx;
|
|
||||||
|
|
||||||
// final double xStart = padding + labelInset;
|
|
||||||
// final double xEnd = size.width - padding - labelInset;
|
|
||||||
// final double chartWidth = xEnd - xStart;
|
|
||||||
|
|
||||||
// double chartHeight = size.height - 30.rpx;
|
|
||||||
|
|
||||||
// int totalDuration =
|
|
||||||
// maxTime.millisecondsSinceEpoch - minTime.millisecondsSinceEpoch;
|
|
||||||
// if (totalDuration <= 0) return;
|
|
||||||
|
|
||||||
// Paint axisPaint = Paint()
|
|
||||||
// ..color = Colors.grey.withOpacity(0.4)
|
|
||||||
// ..strokeWidth = 1.rpx;
|
|
||||||
|
|
||||||
// Paint thresholdPaint = Paint()
|
|
||||||
// ..color = themeController.currentColor.sc9
|
|
||||||
// ..strokeWidth = 1.rpx;
|
|
||||||
|
|
||||||
// // 阈值虚线(红色)
|
|
||||||
// if (threshold != null && threshold! >= 0 && threshold! <= maxY) {
|
|
||||||
// double yThreshold = chartHeight * (1 - threshold! / maxY);
|
|
||||||
// drawDashedLine(
|
|
||||||
// canvas,
|
|
||||||
// Offset(xStart, yThreshold),
|
|
||||||
// Offset(xEnd, yThreshold),
|
|
||||||
// thresholdPaint,
|
|
||||||
// dashWidth: 8.rpx,
|
|
||||||
// dashSpace: 6.rpx,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 绘制数据线段和圆点
|
|
||||||
// for (var item in data) {
|
|
||||||
// int start = item['startTime'];
|
|
||||||
// int end = item['endTime'];
|
|
||||||
// // int times = item['times'];
|
|
||||||
// int times = item['times'];
|
|
||||||
|
|
||||||
// double startX = xStart * 2 +
|
|
||||||
// chartWidth * (start - minTime.millisecondsSinceEpoch) / totalDuration;
|
|
||||||
// double endX = xStart * 2 +
|
|
||||||
// chartWidth * (end - minTime.millisecondsSinceEpoch) / totalDuration;
|
|
||||||
// double y = chartHeight * (1 - times / maxY);
|
|
||||||
|
|
||||||
// // 设置颜色(根据 threshold 判断)
|
|
||||||
// Color pointColor;
|
|
||||||
// if (threshold != null && times >= threshold!) {
|
|
||||||
// pointColor = themeController.currentColor.sc9;
|
|
||||||
// } else {
|
|
||||||
// pointColor = stringToColor("#00C1AA");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Paint dynamicLinePaint = Paint()
|
|
||||||
// ..style = PaintingStyle.stroke
|
|
||||||
// ..strokeWidth = 3.rpx
|
|
||||||
// ..color = pointColor
|
|
||||||
// ..strokeCap = StrokeCap.round;
|
|
||||||
|
|
||||||
// Paint dynamicCirclePaint = Paint()
|
|
||||||
// ..style = PaintingStyle.fill
|
|
||||||
// ..color = pointColor;
|
|
||||||
|
|
||||||
// // 画线段
|
|
||||||
// canvas.drawLine(Offset(startX, y), Offset(endX, y), dynamicLinePaint);
|
|
||||||
|
|
||||||
// // 画起点和终点圆点
|
|
||||||
// canvas.drawCircle(Offset(startX, y), 6.rpx, dynamicCirclePaint);
|
|
||||||
// canvas.drawCircle(Offset(endX, y), 6.rpx, dynamicCirclePaint);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Y轴辅助线和文字
|
|
||||||
// for (int i = 0; i <= ySegments; i++) {
|
|
||||||
// double y = chartHeight * i / ySegments;
|
|
||||||
|
|
||||||
// if (i == ySegments) {
|
|
||||||
// canvas.drawLine(Offset(xStart, y), Offset(xEnd, y), axisPaint);
|
|
||||||
// } else {
|
|
||||||
// drawDashedLine(
|
|
||||||
// canvas,
|
|
||||||
// Offset(xStart, y),
|
|
||||||
// Offset(xEnd, y),
|
|
||||||
// axisPaint,
|
|
||||||
// dashWidth: 8.rpx,
|
|
||||||
// dashSpace: 6.rpx,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// TextPainter tp = TextPainter(
|
|
||||||
// text: TextSpan(
|
|
||||||
// text: '${maxY - (maxY * i / ySegments).round()}',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 18.rpx,
|
|
||||||
// color: themeController.currentColor.sc4,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// textDirection: ui.TextDirection.ltr,
|
|
||||||
// );
|
|
||||||
// tp.layout();
|
|
||||||
// tp.paint(canvas, Offset(0, y - tp.height / 2));
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // X轴主线
|
|
||||||
// canvas.drawLine(
|
|
||||||
// Offset(xStart, chartHeight),
|
|
||||||
// Offset(xEnd, chartHeight),
|
|
||||||
// axisPaint,
|
|
||||||
// );
|
|
||||||
|
|
||||||
// // X轴时间文字(左右两侧)
|
|
||||||
// String leftLabel = DateFormat('HH:mm').format(minTime);
|
|
||||||
// TextPainter leftTp = TextPainter(
|
|
||||||
// text: TextSpan(
|
|
||||||
// text: leftLabel,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 18.rpx,
|
|
||||||
// color: themeController.currentColor.sc4,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// textDirection: ui.TextDirection.ltr,
|
|
||||||
// );
|
|
||||||
// leftTp.layout();
|
|
||||||
// leftTp.paint(canvas,
|
|
||||||
// Offset(padding + labelInset - leftTp.width / 2, chartHeight + 8.rpx));
|
|
||||||
|
|
||||||
// String rightLabel = DateFormat('HH:mm').format(maxTime);
|
|
||||||
// TextPainter rightTp = TextPainter(
|
|
||||||
// text: TextSpan(
|
|
||||||
// text: rightLabel,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 18.rpx,
|
|
||||||
// color: themeController.currentColor.sc4,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// textDirection: ui.TextDirection.ltr,
|
|
||||||
// );
|
|
||||||
// rightTp.layout();
|
|
||||||
// rightTp.paint(
|
|
||||||
// canvas,
|
|
||||||
// Offset(size.width - padding - labelInset - rightTp.width / 2,
|
|
||||||
// chartHeight + 8.rpx));
|
|
||||||
|
|
||||||
// // 中间小时刻度
|
|
||||||
// int totalHours = maxTime.difference(minTime).inHours + 1;
|
|
||||||
// int startHour = minTime.hour;
|
|
||||||
|
|
||||||
// for (int i = 1; i < totalHours; i++) {
|
|
||||||
// double x = xStart + chartWidth * i / totalHours;
|
|
||||||
|
|
||||||
// int hourLabelNum = (startHour + i) % 24;
|
|
||||||
// String hourLabel = '$hourLabelNum';
|
|
||||||
|
|
||||||
// TextPainter tp = TextPainter(
|
|
||||||
// text: TextSpan(
|
|
||||||
// text: hourLabel,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 18.rpx,
|
|
||||||
// color: themeController.currentColor.sc4,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// textDirection: ui.TextDirection.ltr,
|
|
||||||
// );
|
|
||||||
// tp.layout();
|
|
||||||
// tp.paint(canvas, Offset(x - tp.width / 2, chartHeight + 8.rpx));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
|
|
||||||
|
|
||||||
// void drawDashedLine(
|
|
||||||
// Canvas canvas,
|
|
||||||
// Offset start,
|
|
||||||
// Offset end,
|
|
||||||
// Paint paint, {
|
|
||||||
// required double dashWidth,
|
|
||||||
// required double dashSpace,
|
|
||||||
// }) {
|
|
||||||
// final dx = end.dx - start.dx;
|
|
||||||
// final dy = end.dy - start.dy;
|
|
||||||
// final distance = sqrt(dx * dx + dy * dy);
|
|
||||||
// final direction = Offset(dx / distance, dy / distance);
|
|
||||||
|
|
||||||
// double drawn = 0;
|
|
||||||
// while (drawn < distance) {
|
|
||||||
// final from = start + direction * drawn;
|
|
||||||
// final to = start + direction * (drawn + dashWidth).clamp(0, distance);
|
|
||||||
// canvas.drawLine(from, to, paint);
|
|
||||||
// drawn += dashWidth + dashSpace;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
|
|
||||||
@@ -559,10 +201,14 @@ class _LineChartByRangePainter extends CustomPainter {
|
|||||||
int end = item['endTime'];
|
int end = item['endTime'];
|
||||||
int times = item['times'];
|
int times = item['times'];
|
||||||
|
|
||||||
double startX = xStart * 2 +
|
double startX = xStart +
|
||||||
chartWidth * (start - minTime.millisecondsSinceEpoch) / totalDuration;
|
chartWidth * (start - minTime.millisecondsSinceEpoch) / totalDuration;
|
||||||
double endX = xStart * 2 +
|
double endX = xStart +
|
||||||
chartWidth * (end - minTime.millisecondsSinceEpoch) / totalDuration;
|
chartWidth * (end - minTime.millisecondsSinceEpoch) / totalDuration;
|
||||||
|
|
||||||
|
if (startX == endX) {
|
||||||
|
endX = startX + 2.rpx; // 至少显示 2.rpx 的线段
|
||||||
|
}
|
||||||
double y = chartHeight * (1 - times / maxY);
|
double y = chartHeight * (1 - times / maxY);
|
||||||
|
|
||||||
// 设置颜色(根据 threshold 判断)
|
// 设置颜色(根据 threshold 判断)
|
||||||
|
|||||||
@@ -49,8 +49,10 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 找出数据中的实际最小值和最大值
|
// 找出数据中的实际最小值和最大值
|
||||||
double dataMin = validPoints.map((point) => point.value).reduce((a, b) => a < b ? a : b);
|
double dataMin =
|
||||||
double dataMax = validPoints.map((point) => point.value).reduce((a, b) => a > b ? a : b);
|
validPoints.map((point) => point.value).reduce((a, b) => a < b ? a : b);
|
||||||
|
double dataMax =
|
||||||
|
validPoints.map((point) => point.value).reduce((a, b) => a > b ? a : b);
|
||||||
|
|
||||||
// 设置默认范围
|
// 设置默认范围
|
||||||
double yMin = 8.0;
|
double yMin = 8.0;
|
||||||
@@ -139,8 +141,8 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: themeController.currentColor.sc5,
|
color: themeController.currentColor.sc5,
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius:
|
||||||
AppConstants().normal_container_radius),
|
BorderRadius.circular(AppConstants().normal_container_radius),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding:
|
||||||
@@ -205,8 +207,8 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
padding:
|
||||||
0, 0.rpx, 0.rpx, 0),
|
EdgeInsetsDirectional.fromSTEB(0, 0.rpx, 0.rpx, 0),
|
||||||
width: 28.rpx,
|
width: 28.rpx,
|
||||||
height: 28.rpx,
|
height: 28.rpx,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
@@ -242,8 +244,7 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
|
|||||||
Text(
|
Text(
|
||||||
'正常范围'.tr + "${range}",
|
'正常范围'.tr + "${range}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize:
|
fontSize: AppConstants().smaller_text_fontSize,
|
||||||
AppConstants().smaller_text_fontSize,
|
|
||||||
color: themeController.currentColor.sc3,
|
color: themeController.currentColor.sc3,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -264,150 +265,162 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
|
|||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// Padding(
|
||||||
|
// padding:
|
||||||
|
// EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
// children: [
|
||||||
|
// Column(
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${avgBreath['name']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize: AppConstants().normal_text_fontSize),
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${avgBreath['value']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc2,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().normal_text_fontSize),
|
||||||
|
// ),
|
||||||
|
// Text(
|
||||||
|
// "${avgBreath['unit']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize: AppConstants().small_text_fontSize),
|
||||||
|
// ),
|
||||||
|
// ].divide(SizedBox(
|
||||||
|
// width: 6.rpx,
|
||||||
|
// )),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// Column(
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${baseBreath['name']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize: AppConstants().normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${baseBreath['value']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc2,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Text(
|
||||||
|
// "${baseBreath['unit']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize: AppConstants().small_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// ].divide(SizedBox(
|
||||||
|
// width: 6.rpx,
|
||||||
|
// )),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// Column(
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${minBreath['name']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize: AppConstants().normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${minBreath['value']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc2,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Text(
|
||||||
|
// "${minBreath['unit']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize: AppConstants().small_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// ].divide(SizedBox(
|
||||||
|
// width: 6.rpx,
|
||||||
|
// )),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// Column(
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${maxBreath['name']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize: AppConstants().normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${maxBreath['value']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc2,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Text(
|
||||||
|
// "${maxBreath['unit']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize: AppConstants().small_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// ].divide(SizedBox(
|
||||||
|
// width: 6.rpx,
|
||||||
|
// )),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
children: [
|
children: [
|
||||||
Column(
|
_buildBreathItem(avgBreath),
|
||||||
children: [
|
_buildBreathItem(baseBreath),
|
||||||
Text(
|
_buildBreathItem(minBreath),
|
||||||
"${avgBreath['name']}",
|
_buildBreathItem(maxBreath),
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize: AppConstants().normal_text_fontSize),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${avgBreath['value']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc2,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().normal_text_fontSize),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"${avgBreath['unit']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize: AppConstants().small_text_fontSize),
|
|
||||||
),
|
|
||||||
].divide(SizedBox(
|
|
||||||
width: 6.rpx,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${baseBreath['name']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize: AppConstants().normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${baseBreath['value']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc2,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"${baseBreath['unit']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize: AppConstants().small_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
].divide(SizedBox(
|
|
||||||
width: 6.rpx,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${minBreath['name']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize: AppConstants().normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${minBreath['value']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc2,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"${minBreath['unit']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize: AppConstants().small_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
].divide(SizedBox(
|
|
||||||
width: 6.rpx,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${maxBreath['name']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize: AppConstants().normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${maxBreath['value']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc2,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"${maxBreath['unit']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize: AppConstants().small_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
].divide(SizedBox(
|
|
||||||
width: 6.rpx,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -420,4 +433,70 @@ class _BreatheStandardWidgetState extends State<BreatheStandardWidget> {
|
|||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildBreathItem(Map<String, dynamic> data) {
|
||||||
|
return Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 4.rpx, vertical: 4.rpx),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// 名称 - 最多2行
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
"${data['name']}",
|
||||||
|
style: TextStyle(
|
||||||
|
color: themeController.currentColor.sc3,
|
||||||
|
fontSize: AppConstants().normal_text_fontSize,
|
||||||
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 4.rpx),
|
||||||
|
// 值 + 单位 - 最多2行
|
||||||
|
Flexible(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
fit: FlexFit.loose,
|
||||||
|
child: Text(
|
||||||
|
"${data['value']}",
|
||||||
|
style: TextStyle(
|
||||||
|
color: themeController.currentColor.sc2,
|
||||||
|
fontSize: AppConstants().normal_text_fontSize,
|
||||||
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 4.rpx),
|
||||||
|
Flexible(
|
||||||
|
fit: FlexFit.loose,
|
||||||
|
child: Text(
|
||||||
|
"${data['unit']}",
|
||||||
|
style: TextStyle(
|
||||||
|
color: themeController.currentColor.sc3,
|
||||||
|
fontSize: AppConstants().small_text_fontSize,
|
||||||
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -61,11 +61,15 @@ class _DiseasePercentsWidgetState extends State<DiseasePercentsWidget> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
"慢性病风险指数".tr,
|
"慢性病风险指数".tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: themeController.currentColor.sc3,
|
color: themeController.currentColor.sc3,
|
||||||
fontSize: AppConstants().title_text_fontSize),
|
fontSize: AppConstants().title_text_fontSize),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
ClickableContainer(
|
ClickableContainer(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
@@ -76,7 +80,8 @@ class _DiseasePercentsWidgetState extends State<DiseasePercentsWidget> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
// 你的点击逻辑
|
// 你的点击逻辑
|
||||||
|
|
||||||
if (AppConstants().ent_type == APPPackageType.MHT.code) {
|
if (AppConstants().ent_type ==
|
||||||
|
APPPackageType.MHT.code) {
|
||||||
showTipDialog(
|
showTipDialog(
|
||||||
context,
|
context,
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@@ -63,11 +63,15 @@ class _HeartChangeWidgetState extends State<HeartChangeWidget> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
"心率变异性(HRV)".tr,
|
"心率变异性(HRV)".tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: themeController.currentColor.sc3,
|
color: themeController.currentColor.sc3,
|
||||||
fontSize: AppConstants().title_text_fontSize),
|
fontSize: AppConstants().title_text_fontSize),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
ClickableContainer(
|
ClickableContainer(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ class _HeartHealthWidgetState extends State<HeartHealthWidget> {
|
|||||||
context,
|
context,
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
// "心理健康评估介绍".tr,
|
|
||||||
"心率健康评估主要通过用户睡眠报告中的时间点、体征数据及HRV数据等信息,来判断其心理健康水平、疲劳程度。"
|
"心率健康评估主要通过用户睡眠报告中的时间点、体征数据及HRV数据等信息,来判断其心理健康水平、疲劳程度。"
|
||||||
.tr,
|
.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -140,12 +139,18 @@ class _HeartHealthWidgetState extends State<HeartHealthWidget> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
FatigueCircleIndicator(
|
Flexible(
|
||||||
|
flex: 1,
|
||||||
|
child: FatigueCircleIndicator(
|
||||||
data: showLabel[0],
|
data: showLabel[0],
|
||||||
),
|
),
|
||||||
FatigueCircleIndicator(
|
),
|
||||||
|
Flexible(
|
||||||
|
flex: 1,
|
||||||
|
child: FatigueCircleIndicator(
|
||||||
data: showLabel[1],
|
data: showLabel[1],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
].divide(SizedBox(
|
].divide(SizedBox(
|
||||||
width: 110.rpx,
|
width: 110.rpx,
|
||||||
)),
|
)),
|
||||||
|
|||||||
@@ -82,11 +82,15 @@ class _HeartPointWidgetState extends State<HeartPointWidget> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
"心率散点图".tr,
|
"心率散点图".tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: themeController.currentColor.sc3,
|
color: themeController.currentColor.sc3,
|
||||||
fontSize: AppConstants().title_text_fontSize),
|
fontSize: AppConstants().title_text_fontSize),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
maxLines: 1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
ClickableContainer(
|
ClickableContainer(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
|||||||
@@ -249,158 +249,170 @@ class _HeartRateStandardWidgetState extends State<HeartRateStandardWidget> {
|
|||||||
// actYMax: max.toDouble(),
|
// actYMax: max.toDouble(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// Padding(
|
||||||
|
// padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
// 30.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
// children: [
|
||||||
|
// Column(
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${avgHeartRate['name']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().normal_text_fontSize),
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${avgHeartRate['value']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc2,
|
||||||
|
// fontSize: AppConstants()
|
||||||
|
// .normal_text_fontSize),
|
||||||
|
// ),
|
||||||
|
// Text(
|
||||||
|
// "${avgHeartRate['unit']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().small_text_fontSize),
|
||||||
|
// ),
|
||||||
|
// ].divide(SizedBox(
|
||||||
|
// width: 6.rpx,
|
||||||
|
// )),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// Column(
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${baseHeartRate['name']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${baseHeartRate['value']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc2,
|
||||||
|
// fontSize: AppConstants()
|
||||||
|
// .normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Text(
|
||||||
|
// "${baseHeartRate['unit']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().small_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// ].divide(SizedBox(
|
||||||
|
// width: 6.rpx,
|
||||||
|
// )),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// Column(
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${minHeartRate['name']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${minHeartRate['value']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc2,
|
||||||
|
// fontSize: AppConstants()
|
||||||
|
// .normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Text(
|
||||||
|
// "${minHeartRate['unit']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().small_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// ].divide(SizedBox(
|
||||||
|
// width: 6.rpx,
|
||||||
|
// )),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// Column(
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${maxHeartRate['name']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// "${maxHeartRate['value']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc2,
|
||||||
|
// fontSize: AppConstants()
|
||||||
|
// .normal_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// Text(
|
||||||
|
// "${maxHeartRate['unit']}",
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: themeController.currentColor.sc3,
|
||||||
|
// fontSize:
|
||||||
|
// AppConstants().small_text_fontSize),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// ].divide(SizedBox(
|
||||||
|
// width: 6.rpx,
|
||||||
|
// )),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
30.rpx, 0.rpx, 0.rpx, 0.rpx),
|
30.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
children: [
|
children: [
|
||||||
Column(
|
_buildHeartRateItem(avgHeartRate),
|
||||||
children: [
|
_buildHeartRateItem(baseHeartRate),
|
||||||
Text(
|
_buildHeartRateItem(minHeartRate),
|
||||||
"${avgHeartRate['name']}",
|
_buildHeartRateItem(maxHeartRate),
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().normal_text_fontSize),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${avgHeartRate['value']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc2,
|
|
||||||
fontSize: AppConstants()
|
|
||||||
.normal_text_fontSize),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"${avgHeartRate['unit']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().small_text_fontSize),
|
|
||||||
),
|
|
||||||
].divide(SizedBox(
|
|
||||||
width: 6.rpx,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${baseHeartRate['name']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${baseHeartRate['value']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc2,
|
|
||||||
fontSize: AppConstants()
|
|
||||||
.normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"${baseHeartRate['unit']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().small_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
].divide(SizedBox(
|
|
||||||
width: 6.rpx,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${minHeartRate['name']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${minHeartRate['value']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc2,
|
|
||||||
fontSize: AppConstants()
|
|
||||||
.normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"${minHeartRate['unit']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().small_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
].divide(SizedBox(
|
|
||||||
width: 6.rpx,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${maxHeartRate['name']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${maxHeartRate['value']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc2,
|
|
||||||
fontSize: AppConstants()
|
|
||||||
.normal_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"${maxHeartRate['unit']}",
|
|
||||||
style: TextStyle(
|
|
||||||
color: themeController.currentColor.sc3,
|
|
||||||
fontSize:
|
|
||||||
AppConstants().small_text_fontSize),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
].divide(SizedBox(
|
|
||||||
width: 6.rpx,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -418,4 +430,70 @@ class _HeartRateStandardWidgetState extends State<HeartRateStandardWidget> {
|
|||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildHeartRateItem(Map<String, dynamic> data) {
|
||||||
|
return Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 4.rpx, vertical: 4.rpx),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// 名称 - 最多2行
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
"${data['name']}",
|
||||||
|
style: TextStyle(
|
||||||
|
color: themeController.currentColor.sc3,
|
||||||
|
fontSize: AppConstants().normal_text_fontSize,
|
||||||
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 4.rpx),
|
||||||
|
// 值 + 单位 - 最多2行
|
||||||
|
Flexible(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
fit: FlexFit.loose,
|
||||||
|
child: Text(
|
||||||
|
"${data['value']}",
|
||||||
|
style: TextStyle(
|
||||||
|
color: themeController.currentColor.sc2,
|
||||||
|
fontSize: AppConstants().normal_text_fontSize,
|
||||||
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 6.rpx),
|
||||||
|
Flexible(
|
||||||
|
fit: FlexFit.loose,
|
||||||
|
child: Text(
|
||||||
|
"${data['unit']}",
|
||||||
|
style: TextStyle(
|
||||||
|
color: themeController.currentColor.sc3,
|
||||||
|
fontSize: AppConstants().small_text_fontSize,
|
||||||
|
),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ class _SkinPercentWidgetState extends State<SkinPercentWidget> {
|
|||||||
context,
|
context,
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
// "心理健康评估介绍".tr,
|
|
||||||
"皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。"
|
"皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。"
|
||||||
.tr,
|
.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@@ -37,12 +37,16 @@ class SleepChartContainer extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
title,
|
title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 30.rpx,
|
fontSize: 30.rpx,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
ClickableContainer(
|
ClickableContainer(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
|||||||
@@ -158,6 +158,8 @@ class _SleepScoreWidgetState extends State<SleepScoreWidget> {
|
|||||||
fontSize:
|
fontSize:
|
||||||
AppConstants().normal_text_fontSize,
|
AppConstants().normal_text_fontSize,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -1,380 +1,3 @@
|
|||||||
// import 'package:EasyDartModule/EasyDartModule.dart' as es;
|
|
||||||
// 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/enum/APPPackageType.dart';
|
|
||||||
// import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
|
||||||
// import 'package:vbvs_app/pages/sleep_report/chart/SnoreChart.dart';
|
|
||||||
|
|
||||||
// class SnoreViewWidgetWidget extends StatefulWidget {
|
|
||||||
// var sleepReport;
|
|
||||||
// SnoreViewWidgetWidget({super.key, required this.sleepReport});
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// State<SnoreViewWidgetWidget> createState() => _SnoreViewWidgetWidgetState();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// class _SnoreViewWidgetWidgetState extends State<SnoreViewWidgetWidget> {
|
|
||||||
// @override
|
|
||||||
// void setState(VoidCallback callback) {
|
|
||||||
// super.setState(callback);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// try {
|
|
||||||
// if (widget.sleepReport == null ||
|
|
||||||
// widget.sleepReport is! Map ||
|
|
||||||
// widget.sleepReport.isEmpty) {
|
|
||||||
// return Container();
|
|
||||||
// }
|
|
||||||
// // if (APPPackageType.TH.code == AppConstants().ent_type) {
|
|
||||||
// // return Container();
|
|
||||||
// // }
|
|
||||||
// double maxY = 250;
|
|
||||||
// var startTime = widget.sleepReport['startTime'];
|
|
||||||
// var endTime = widget.sleepReport['endTime'];
|
|
||||||
// List snoreValues = [];
|
|
||||||
|
|
||||||
// List type = widget.sleepReport['ssp']['type'];
|
|
||||||
// List lightSnore = widget.sleepReport['ssp']['data'][0];
|
|
||||||
// List heavySnore = widget.sleepReport['ssp']['data'][1];
|
|
||||||
|
|
||||||
// // lightSnore = [
|
|
||||||
// // ...lightSnore,
|
|
||||||
// // {
|
|
||||||
// // 'st': widget.sleepReport['startTime'] + 2 * 60 * 60 * 1000, // 开始后2小时
|
|
||||||
// // 'et': widget.sleepReport['startTime'] + 2 * 60 * 65 * 1000, // 持续5分钟
|
|
||||||
// // 'value': 25,
|
|
||||||
// // },
|
|
||||||
// // {
|
|
||||||
// // 'st': widget.sleepReport['startTime'] + 4 * 60 * 60 * 1000, // 开始后4小时
|
|
||||||
// // 'et': widget.sleepReport['startTime'] + 4 * 60 * 68 * 1000, // 持续8分钟
|
|
||||||
// // 'value': 18,
|
|
||||||
// // }
|
|
||||||
// // ];
|
|
||||||
|
|
||||||
// // // 添加模拟数据到重度打鼾列表
|
|
||||||
// // heavySnore = [
|
|
||||||
// // ...heavySnore,
|
|
||||||
// // {
|
|
||||||
// // 'st': widget.sleepReport['startTime'] + 3 * 60 * 60 * 1000, // 开始后3小时
|
|
||||||
// // 'et': widget.sleepReport['startTime'] + 3 * 60 * 62 * 1000, // 持续2分钟
|
|
||||||
// // 'value': 68,
|
|
||||||
// // },
|
|
||||||
// // {
|
|
||||||
// // 'st': widget.sleepReport['startTime'] + 5 * 60 * 60 * 1000, // 开始后5小时
|
|
||||||
// // 'et': widget.sleepReport['startTime'] + 5 * 60 * 64 * 1000, // 持续4分钟
|
|
||||||
// // 'value': 72,
|
|
||||||
// // }
|
|
||||||
// // ];
|
|
||||||
|
|
||||||
// List<Map> processedLightSnore = lightSnore.map((item) {
|
|
||||||
// return {
|
|
||||||
// ...item,
|
|
||||||
// 'id': type[0]['id'],
|
|
||||||
// 'name': type[0]['name'],
|
|
||||||
// 'color': type[0]['color'],
|
|
||||||
// };
|
|
||||||
// }).toList();
|
|
||||||
|
|
||||||
// List<Map> processedHeavySnore = heavySnore.map((item) {
|
|
||||||
// return {
|
|
||||||
// ...item,
|
|
||||||
// 'id': type[1]['id'],
|
|
||||||
// 'name': type[1]['name'],
|
|
||||||
// 'color': type[1]['color'],
|
|
||||||
// };
|
|
||||||
// }).toList();
|
|
||||||
|
|
||||||
// snoreValues = [...processedLightSnore, ...processedHeavySnore];
|
|
||||||
// snoreValues.sort((a, b) => a['st'].compareTo(b['st']));
|
|
||||||
// print(snoreValues);
|
|
||||||
// List<BarData> barDataList = snoreValues.map<BarData>((item) {
|
|
||||||
// return BarData(
|
|
||||||
// st: item['st'],
|
|
||||||
// et: item['et'],
|
|
||||||
// value: (item['value'] as num).toDouble() > maxY
|
|
||||||
// ? maxY + 3
|
|
||||||
// : (item['value'] as num).toDouble(),
|
|
||||||
// id: item['id'],
|
|
||||||
// name: item['name'],
|
|
||||||
// color: (item['color'] == null || item['color'].isEmpty)
|
|
||||||
// ? (item['id'] == 1 ? Colors.green : Colors.red)
|
|
||||||
// : stringToColor(item['color']),
|
|
||||||
// );
|
|
||||||
// }).toList();
|
|
||||||
|
|
||||||
// // List<Map<String, dynamic>> data =
|
|
||||||
// // (widget.sleepReport['ssp'] as List).cast<Map<String, dynamic>>();
|
|
||||||
// // List<Map<String, dynamic>> showLabel = convertToShowLabel(data);
|
|
||||||
|
|
||||||
// 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, 10.rpx, 14.rpx, 10.rpx), //
|
|
||||||
// borderRadius: 0.rpx, // 圆形点击区域
|
|
||||||
// onTap: () {
|
|
||||||
// if (AppConstants().ent_type ==
|
|
||||||
// APPPackageType.MHT.code) {
|
|
||||||
// showTipDialog(
|
|
||||||
// context,
|
|
||||||
// Container(
|
|
||||||
// child: Text(
|
|
||||||
// // "打鼾监测介绍。",
|
|
||||||
// "打鼾监测是指用户在睡眠过程中打鼾频次的图表说明。".tr,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 26.rpx,
|
|
||||||
// color: Colors.black,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// backgroundColor: Color(0xFFFFFFFF),
|
|
||||||
// colors: [
|
|
||||||
// Color(0XFF1592AA),
|
|
||||||
// Color(0xFF0C83A7),
|
|
||||||
// Color(0xFF006FA3)
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// } else {
|
|
||||||
// showTipDialog(
|
|
||||||
// context,
|
|
||||||
// Container(
|
|
||||||
// child: Text(
|
|
||||||
// "打鼾监测是指用户在睡眠过程中打鼾频次的图表说明。".tr,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 26.rpx,
|
|
||||||
// color: themeController.currentColor.sc3,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// backgroundColor: themeController.currentColor.sc17,
|
|
||||||
// colors: AppConstants().thNormalButton,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// 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,
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// "次".tr,
|
|
||||||
// style: TextStyle(
|
|
||||||
// color: stringToColor("#FFFFFF"), fontSize: 18.rpx),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Padding(
|
|
||||||
// padding: EdgeInsetsDirectional.fromSTEB(
|
|
||||||
// 0.rpx, 40.rpx, 20.rpx, 0.rpx),
|
|
||||||
// // child: LineChartByRange(
|
|
||||||
// // showLabel: showLabel,
|
|
||||||
// // startTime: startTime,
|
|
||||||
// // endTime: endTime,
|
|
||||||
// // ),
|
|
||||||
// child: BarChartWidget(
|
|
||||||
// data: barDataList,
|
|
||||||
// startTime: startTime,
|
|
||||||
// endTime: endTime,
|
|
||||||
// maxYValue: maxY, // 最大值可自定义
|
|
||||||
// yStepCount: 3, // 分4段(0, 5, 10, 15, 20)
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Padding(
|
|
||||||
// padding:
|
|
||||||
// EdgeInsetsDirectional.fromSTEB(0.rpx, 52.rpx, 0.rpx, 0.rpx),
|
|
||||||
// child: Container(
|
|
||||||
// child: Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
// children: [
|
|
||||||
// Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center, // 左对齐
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// // 小圆球
|
|
||||||
// Container(
|
|
||||||
// width: 14.rpx,
|
|
||||||
// height: 14.rpx,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: (type[0]?['color'] == null ||
|
|
||||||
// type[0]?['color'].isEmpty)
|
|
||||||
// ? Colors.green
|
|
||||||
// : stringToColor(
|
|
||||||
// "${type[0]['color']}"), // 你想要的颜色
|
|
||||||
// shape: BoxShape.circle,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(width: 12.rpx), // 小圆球和文字间距
|
|
||||||
// Text(
|
|
||||||
// '${type[0]?['name']}',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize:
|
|
||||||
// AppConstants().normal_text_fontSize,
|
|
||||||
// color: themeController.currentColor.sc3),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 16.rpx), // 两行文字间距
|
|
||||||
// Text(
|
|
||||||
// '${(type[0]?['value'] == null || type[0]['value'].toString().isEmpty) ? '未知数据'.tr : '${type[0]?['value']}${(type[0]?['unit'] == null || type[0]['unit'].toString().isEmpty) ? '' : type[0]?['unit']}'}',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: AppConstants().small_text_fontSize,
|
|
||||||
// color: themeController.currentColor.sc4),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center, // 左对齐
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// // 小圆球
|
|
||||||
// Container(
|
|
||||||
// width: 14.rpx,
|
|
||||||
// height: 14.rpx,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: (type[1]?['color'] == null ||
|
|
||||||
// type[1]?['color'].isEmpty)
|
|
||||||
// ? Colors.red
|
|
||||||
// : stringToColor(
|
|
||||||
// "${type[1]['color']}"), // 你想要的颜色
|
|
||||||
// shape: BoxShape.circle,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(width: 12.rpx), // 小圆球和文字间距
|
|
||||||
// Text(
|
|
||||||
// '${type[1]?['name']}',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize:
|
|
||||||
// AppConstants().normal_text_fontSize,
|
|
||||||
// color: themeController.currentColor.sc3),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 16.rpx), // 两行文字间距
|
|
||||||
// Text(
|
|
||||||
// '${(type[1]?['value'] == null || type[1]['value'].toString().isEmpty) ? '未知数据'.tr : '${type[1]?['value']}${(type[1]?['unit'] == null || type[1]['unit'].toString().isEmpty) ? '' : type[1]?['unit']}'}',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: AppConstants().small_text_fontSize,
|
|
||||||
// color: themeController.currentColor.sc4),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 52.rpx,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// } catch (e) {
|
|
||||||
// es.EasyDartModule.logger.error("打鼾监测绘制异常${e}");
|
|
||||||
// return Container();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// List<Map<String, dynamic>> convertToShowLabel(
|
|
||||||
// List<Map<String, dynamic>> data) {
|
|
||||||
// if (data.isEmpty) return [];
|
|
||||||
|
|
||||||
// data.sort((a, b) => a['st'].compareTo(b['st'])); // 确保时间有序
|
|
||||||
|
|
||||||
// List<Map<String, dynamic>> result = [];
|
|
||||||
|
|
||||||
// int startTime = data[0]['st'];
|
|
||||||
// int endTime = data[0]['et'];
|
|
||||||
// int currentValue = data[0]['value'];
|
|
||||||
|
|
||||||
// for (int i = 1; i < data.length; i++) {
|
|
||||||
// final item = data[i];
|
|
||||||
// final st = item['st'];
|
|
||||||
// final value = item['value'];
|
|
||||||
// final et = item['et'];
|
|
||||||
|
|
||||||
// if (value == currentValue) {
|
|
||||||
// endTime = st;
|
|
||||||
// } else {
|
|
||||||
// result.add({
|
|
||||||
// "startTime": startTime,
|
|
||||||
// "endTime": endTime,
|
|
||||||
// "times": currentValue,
|
|
||||||
// });
|
|
||||||
// startTime = st;
|
|
||||||
// endTime = et;
|
|
||||||
// currentValue = value;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 添加最后一段
|
|
||||||
// result.add({
|
|
||||||
// "startTime": startTime,
|
|
||||||
// "endTime": endTime,
|
|
||||||
// "times": currentValue,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
import 'package:EasyDartModule/EasyDartModule.dart' as es;
|
import 'package:EasyDartModule/EasyDartModule.dart' as es;
|
||||||
import 'package:ef/ef.dart';
|
import 'package:ef/ef.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|||||||
@@ -42,12 +42,16 @@ class _TrendDataTablePageState extends State<TrendDataTablePage> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
widget.title,
|
widget.title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 30.rpx,
|
fontSize: 30.rpx,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
ClickableContainer(
|
ClickableContainer(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
|||||||
@@ -47,12 +47,16 @@ class IndicatorCompareCard extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
title.tr,
|
title.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: themeController.currentColor.sc3,
|
color: themeController.currentColor.sc3,
|
||||||
fontSize: AppConstants().title_text_fontSize,
|
fontSize: AppConstants().title_text_fontSize,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
if (tooltip != null)
|
if (tooltip != null)
|
||||||
ClickableContainer(
|
ClickableContainer(
|
||||||
|
|||||||
@@ -247,6 +247,8 @@ class _VitalSignsWidgetState extends State<VitalSignsWidget> {
|
|||||||
color: stringToColor("#929699"),
|
color: stringToColor("#929699"),
|
||||||
fontSize: AppConstants().normal_text_fontSize,
|
fontSize: AppConstants().normal_text_fontSize,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -82,11 +82,15 @@ class _ZiZhuShenJingPercentWidgetState
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
"自主神经平衡指数".tr,
|
"自主神经平衡指数".tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: themeController.currentColor.sc3,
|
color: themeController.currentColor.sc3,
|
||||||
fontSize: AppConstants().title_text_fontSize),
|
fontSize: AppConstants().title_text_fontSize),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
ClickableContainer(
|
ClickableContainer(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
@@ -95,7 +99,8 @@ class _ZiZhuShenJingPercentWidgetState
|
|||||||
14.rpx, 10.rpx, 14.rpx, 10.rpx), //
|
14.rpx, 10.rpx, 14.rpx, 10.rpx), //
|
||||||
borderRadius: 0.rpx, // 圆形点击区域
|
borderRadius: 0.rpx, // 圆形点击区域
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (AppConstants().ent_type == APPPackageType.MHT.code) {
|
if (AppConstants().ent_type ==
|
||||||
|
APPPackageType.MHT.code) {
|
||||||
showTipDialog(
|
showTipDialog(
|
||||||
context,
|
context,
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@@ -1440,6 +1440,8 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
|||||||
? themeController.currentColor.sc2
|
? themeController.currentColor.sc2
|
||||||
: themeController.currentColor.sc3,
|
: themeController.currentColor.sc3,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10.rpx),
|
SizedBox(height: 10.rpx),
|
||||||
|
|||||||
@@ -88,6 +88,9 @@ dependencies:
|
|||||||
ref: main
|
ref: main
|
||||||
open_file: ^3.5.11
|
open_file: ^3.5.11
|
||||||
device_info_plus: ^10.0.0
|
device_info_plus: ^10.0.0
|
||||||
|
wifi_scan: ^0.4.1+2
|
||||||
|
network_info_plus: ^5.0.1
|
||||||
|
# wifi_info_flutter: ^2.0.2
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|||||||
Reference in New Issue
Block a user