更新样式
This commit is contained in:
@@ -91,7 +91,8 @@ Widget getOnePickers(
|
||||
if (isMonthName && isEn && arr[index] is int) {
|
||||
displayText = DateFormat.MMMM('en').format(DateTime(0, arr[index]));
|
||||
} else {
|
||||
displayText = isEn ? "${arr[index]}" : "${arr[index]}$unit"; // 中文附带单位
|
||||
// displayText = isEn ? "${arr[index]}" : "${arr[index]}$unit"; // 中文附带单位
|
||||
displayText = "${arr[index]}$unit"; // 中文附带单位
|
||||
}
|
||||
|
||||
return Center(
|
||||
@@ -100,7 +101,7 @@ Widget getOnePickers(
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: isSelected
|
||||
? const Color(0xFF011D33)
|
||||
? themeController.currentColor.sc3
|
||||
: const Color(0xFF9AA0B3),
|
||||
fontSize: 30.rpx,
|
||||
fontWeight: FontWeight.normal,
|
||||
|
||||
@@ -259,8 +259,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
||||
30.rpx, 0.rpx, 30.rpx, 100.rpx),
|
||||
child: ClickableContainer(
|
||||
backgroundColor: themeController.currentColor.sc5,
|
||||
highlightColor: themeController
|
||||
.currentColor.sc5, // 或你希望的点击水波纹颜色
|
||||
highlightColor: Colors.transparent, // 点击涟漪颜色
|
||||
borderRadius: AppConstants()
|
||||
.normal_container_radius, // 如果你想加圆角可以设置 eg. 12.rpx
|
||||
padding: EdgeInsets.zero,
|
||||
@@ -547,7 +546,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
||||
)),
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent, // 可自定义背景色
|
||||
highlightColor: Colors.white, // 点击涟漪颜色
|
||||
highlightColor: Colors.transparent, // 点击涟漪颜色
|
||||
borderRadius: 16.rpx, // 圆角大小,可按需调整
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
|
||||
@@ -149,6 +149,9 @@ class _DeviceShareInfoWidgetState extends State<DeviceShareInfoWidget> {
|
||||
item['show'] == false) {
|
||||
return Container();
|
||||
}
|
||||
if (item['k'] == null) {
|
||||
return Container();
|
||||
}
|
||||
return Container(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 62.rpx,
|
||||
|
||||
@@ -177,7 +177,7 @@ class _WifiPageState extends State<WifiPage> {
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -192,7 +192,7 @@ class _WifiPageState extends State<WifiPage> {
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -697,7 +697,7 @@ class _WifiPageState extends State<WifiPage> {
|
||||
Color>(
|
||||
themeController
|
||||
.currentColor
|
||||
.sc1,
|
||||
.sc3,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -910,9 +910,7 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 0, 0, 36.rpx),
|
||||
child: Text(
|
||||
AppConstants().ent_type == 1
|
||||
? '登录页.欢迎使用太和e护'.tr
|
||||
: "欢迎使用欢睡科技",
|
||||
"登录页.其他登录方式".tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
|
||||
@@ -219,6 +219,7 @@ class _HomePageState extends State<HomePage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
weatherModelController.getCurrentWeather();
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/mh_language_controller.dart';
|
||||
import 'package:vbvs_app/controller/weather/weather_controller.dart';
|
||||
import 'package:vbvs_app/enum/APPPackageType.dart';
|
||||
import 'package:vbvs_app/language/AppLanguage.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/FancyCircleCheckbox.dart';
|
||||
@@ -147,6 +148,11 @@ class _LanguagePageState extends State<LanguagePage> {
|
||||
try {
|
||||
// ef.kv.set("language",
|
||||
// language.language_code);
|
||||
WeatherModelController
|
||||
weatherModelController =
|
||||
Get.find();
|
||||
weatherModelController
|
||||
.getCurrentWeather();
|
||||
await ef.kvdb.write(
|
||||
"mht/language",
|
||||
language.language_code);
|
||||
|
||||
@@ -61,7 +61,7 @@ class _HomeDeviceStausWidgetState extends State<HomeDeviceStausWidget> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${(widget.deviceStatus['name'] ?? '').isEmpty ? '未命名'.tr : widget.deviceStatus['name']}',
|
||||
'${(widget.deviceStatus['name'] ?? '').isEmpty ? (widget.deviceStatus['device_type'] == 2 ? '智能电动床'.tr : widget.deviceStatus['device_type'] == 3 ? '律动智能床垫'.tr : '未命名'.tr) : widget.deviceStatus['name']}',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 26.rpx,
|
||||
|
||||
@@ -127,6 +127,7 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
weatherModelController.getCurrentWeather();
|
||||
deviceController.getDeviceList(group: 'room').then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
// TopSlideNotification.show(
|
||||
|
||||
@@ -398,7 +398,7 @@ class _EPageState extends State<PersonPage> {
|
||||
child: Center(
|
||||
child: Text(
|
||||
personController.dateTime != null
|
||||
? DateFormat("yyyy年MM月dd日").format(
|
||||
? DateFormat("yyyy/MM/dd").format(
|
||||
personController.dateTime!)
|
||||
: '人员资料.生日输入提示'.tr,
|
||||
textAlign: TextAlign.right,
|
||||
@@ -459,7 +459,8 @@ class _EPageState extends State<PersonPage> {
|
||||
child: Center(
|
||||
child: Text(
|
||||
personController.height.value != ""
|
||||
? personController.height.value
|
||||
? personController.height.value +
|
||||
"cm".tr
|
||||
: '身高输入提示'.tr,
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
@@ -513,7 +514,8 @@ class _EPageState extends State<PersonPage> {
|
||||
child: Center(
|
||||
child: Text(
|
||||
personController.weight.value != ""
|
||||
? personController.weight.value
|
||||
? personController.weight.value +
|
||||
"kg".tr
|
||||
: '人员资料.体重输入提示'.tr,
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -8,39 +8,339 @@ import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||
|
||||
// Future showDateSelectionDialog(BuildContext context,
|
||||
// {required DateTime checkDate, Function? checkChange, String title = "生日"}) {
|
||||
// ThemeController themeController = Get.find();
|
||||
// List years = [], months = [], days = [];
|
||||
// var days_select = [].obs;
|
||||
// int day_len = 31;
|
||||
// int year = DateTime.now().year;
|
||||
// for (var i = 0; i < 100; i++) {
|
||||
// years.insert(0, year - i);
|
||||
// }
|
||||
// for (var i = 1; i < 13; i++) {
|
||||
// months.add(i);
|
||||
// }
|
||||
// for (var i = 1; i < 32; i++) {
|
||||
// days.add(i);
|
||||
// }
|
||||
// int yearIndex = years.lastIndexOf(checkDate.year);
|
||||
// int monthIndex = months.lastIndexOf(checkDate.month);
|
||||
// day_len = DateTime.fromMillisecondsSinceEpoch(
|
||||
// DateTime(years[yearIndex], months[monthIndex] + 1)
|
||||
// .millisecondsSinceEpoch -
|
||||
// 1000)
|
||||
// .day;
|
||||
// days_select.value = days.sublist(0, day_len);
|
||||
// int dayIndex = days.lastIndexOf(checkDate.day);
|
||||
// return showDialog(
|
||||
// context: context,
|
||||
// barrierDismissible: true, // 点击对话框外部可关闭
|
||||
// builder: (BuildContext context) {
|
||||
// return Stack(
|
||||
// children: [
|
||||
// Positioned(
|
||||
// bottom: 0, // 控制弹窗距离顶部的位置
|
||||
// left: 0,
|
||||
// right: 0,
|
||||
// child: Material(
|
||||
// color: Colors.transparent,
|
||||
// child: Dialog(
|
||||
// backgroundColor: themeController.currentColor.sc17,
|
||||
// insetPadding: EdgeInsets.zero,
|
||||
// shape: RoundedRectangleBorder(
|
||||
// borderRadius: BorderRadius.circular(0),
|
||||
// ),
|
||||
// child: Container(
|
||||
// width: double.infinity,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.only(
|
||||
// topLeft: Radius.circular(
|
||||
// AppConstants().normal_container_radius),
|
||||
// topRight: Radius.circular(
|
||||
// AppConstants().normal_container_radius),
|
||||
// bottomLeft: Radius.circular(0.rpx),
|
||||
// bottomRight: Radius.circular(0.rpx),
|
||||
// ),
|
||||
// ),
|
||||
// child: Column(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: <Widget>[
|
||||
// Container(
|
||||
// color: themeController.currentColor.sc5,
|
||||
// alignment: Alignment.centerLeft,
|
||||
// height: 80.rpx,
|
||||
// child: Padding(
|
||||
// padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// InkWell(
|
||||
// child: Text(
|
||||
// "日期.取消".tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Readex Pro',
|
||||
// color: themeController.currentColor.sc3,
|
||||
// letterSpacing: 0,
|
||||
// fontSize:
|
||||
// AppConstants().normal_text_fontSize),
|
||||
// ),
|
||||
// onTap: () {
|
||||
// Get.back();
|
||||
// },
|
||||
// ),
|
||||
// Text(
|
||||
// "$title",
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Readex Pro',
|
||||
// color: themeController.currentColor.sc3,
|
||||
// letterSpacing: 0,
|
||||
// fontSize:
|
||||
// AppConstants().title_text_fontSize),
|
||||
// ),
|
||||
// // closeIconWhite,
|
||||
// InkWell(
|
||||
// child: Text(
|
||||
// "日期.确定".tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Readex Pro',
|
||||
// color: themeController.currentColor.sc2,
|
||||
// letterSpacing: 0,
|
||||
// fontSize:
|
||||
// AppConstants().normal_text_fontSize),
|
||||
// ),
|
||||
// onTap: () {
|
||||
// checkChange?.call(DateTime(years[yearIndex],
|
||||
// months[monthIndex], days[dayIndex]));
|
||||
// Get.back();
|
||||
// },
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// // Container(
|
||||
// // height: 240.rpx,
|
||||
// // margin: EdgeInsets.only(top: 60.rpx, bottom: 60.rpx),
|
||||
// // padding: EdgeInsets.symmetric(horizontal: 30.rpx),
|
||||
// // child: Row(
|
||||
// // mainAxisAlignment: MainAxisAlignment.center, // ✅ 整体居中
|
||||
// // crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// // children: [
|
||||
// // Row(
|
||||
// // children: [
|
||||
// // SizedBox(
|
||||
// // width: 120.rpx,
|
||||
// // child: getOnePicker(context, years, yearIndex,
|
||||
// // (d) {
|
||||
// // yearIndex = d;
|
||||
// // dayIndex = 0;
|
||||
// // day_len =
|
||||
// // DateTime.fromMillisecondsSinceEpoch(
|
||||
// // DateTime(
|
||||
// // years[yearIndex],
|
||||
// // months[monthIndex] +
|
||||
// // 1)
|
||||
// // .millisecondsSinceEpoch -
|
||||
// // 1000)
|
||||
// // .day;
|
||||
// // days_select.value =
|
||||
// // days.sublist(0, day_len);
|
||||
// // }, "".tr),
|
||||
// // ),
|
||||
// // ],
|
||||
// // ),
|
||||
|
||||
// // SizedBox(width: 100.rpx),
|
||||
|
||||
// // // 月
|
||||
// // Row(
|
||||
// // children: [
|
||||
// // SizedBox(
|
||||
// // width: 80.rpx,
|
||||
// // child: getOnePicker(
|
||||
// // context, months, monthIndex, (d) {
|
||||
// // monthIndex = d;
|
||||
// // dayIndex = 0;
|
||||
// // day_len =
|
||||
// // DateTime.fromMillisecondsSinceEpoch(
|
||||
// // DateTime(
|
||||
// // years[yearIndex],
|
||||
// // months[monthIndex] +
|
||||
// // 1)
|
||||
// // .millisecondsSinceEpoch -
|
||||
// // 1000)
|
||||
// // .day;
|
||||
// // days_select.value =
|
||||
// // days.sublist(0, day_len);
|
||||
// // }, "".tr),
|
||||
// // ),
|
||||
// // ],
|
||||
// // ),
|
||||
|
||||
// // SizedBox(width: 100.rpx),
|
||||
|
||||
// // Row(
|
||||
// // children: [
|
||||
// // SizedBox(
|
||||
// // width: 80.rpx,
|
||||
// // child: Obx(() {
|
||||
// // return getOnePicker(
|
||||
// // context, days_select, dayIndex, (d) {
|
||||
// // dayIndex = d;
|
||||
// // }, "".tr);
|
||||
// // }),
|
||||
// // ),
|
||||
// // ],
|
||||
// // ),
|
||||
// // ],
|
||||
// // ),
|
||||
// // )
|
||||
// //-----
|
||||
// Container(
|
||||
// height: 240.rpx,
|
||||
// margin: EdgeInsets.only(top: 60.rpx, bottom: 60.rpx),
|
||||
// padding: EdgeInsets.symmetric(horizontal: 30.rpx),
|
||||
// child: Stack(
|
||||
// children: [
|
||||
// // ✅ 选中行背景色
|
||||
// Positioned.fill(
|
||||
// child: IgnorePointer(
|
||||
// child: Center(
|
||||
// child: Container(
|
||||
// height: 90.rpx, // 对齐选中行高度
|
||||
// margin: EdgeInsets.symmetric(
|
||||
// horizontal: 10.rpx),
|
||||
// decoration: BoxDecoration(
|
||||
// color: themeController.currentColor.sc2,
|
||||
// borderRadius:
|
||||
// BorderRadius.circular(16.rpx),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
// // ✅ 三列 Picker
|
||||
// Row(
|
||||
// mainAxisAlignment:
|
||||
// MainAxisAlignment.center, // 整体居中
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// // 年
|
||||
// SizedBox(
|
||||
// width: 120.rpx,
|
||||
// child: getOnePicker(context, years, yearIndex,
|
||||
// (d) {
|
||||
// yearIndex = d;
|
||||
// dayIndex = 0;
|
||||
// day_len =
|
||||
// DateTime.fromMillisecondsSinceEpoch(
|
||||
// DateTime(
|
||||
// years[yearIndex],
|
||||
// months[monthIndex] +
|
||||
// 1)
|
||||
// .millisecondsSinceEpoch -
|
||||
// 1000)
|
||||
// .day;
|
||||
// days_select.value =
|
||||
// days.sublist(0, day_len);
|
||||
// }, "".tr),
|
||||
// ),
|
||||
|
||||
// SizedBox(width: 100.rpx),
|
||||
|
||||
// // 月
|
||||
// SizedBox(
|
||||
// width: 80.rpx,
|
||||
// child: getOnePicker(
|
||||
// context, months, monthIndex, (d) {
|
||||
// monthIndex = d;
|
||||
// dayIndex = 0;
|
||||
// day_len =
|
||||
// DateTime.fromMillisecondsSinceEpoch(
|
||||
// DateTime(
|
||||
// years[yearIndex],
|
||||
// months[monthIndex] +
|
||||
// 1)
|
||||
// .millisecondsSinceEpoch -
|
||||
// 1000)
|
||||
// .day;
|
||||
// days_select.value =
|
||||
// days.sublist(0, day_len);
|
||||
// }, "".tr),
|
||||
// ),
|
||||
|
||||
// SizedBox(width: 100.rpx),
|
||||
|
||||
// // 日
|
||||
// SizedBox(
|
||||
// width: 80.rpx,
|
||||
// child: Obx(() {
|
||||
// return getOnePicker(
|
||||
// context, days_select, dayIndex, (d) {
|
||||
// dayIndex = d;
|
||||
// }, "".tr);
|
||||
// }),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
Future showDateSelectionDialog(BuildContext context,
|
||||
{required DateTime checkDate, Function? checkChange, String title = "生日"}) {
|
||||
{required DateTime checkDate,
|
||||
Function? checkChange,
|
||||
String title = "选择生日"}) {
|
||||
ThemeController themeController = Get.find();
|
||||
List years = [], months = [], days = [];
|
||||
var days_select = [].obs;
|
||||
int day_len = 31;
|
||||
int year = DateTime.now().year;
|
||||
for (var i = 0; i < 100; i++) {
|
||||
years.insert(0, year - i);
|
||||
final bool isEn = Get.locale?.languageCode.startsWith('en') ?? false;
|
||||
Color checkColor = stringToColor("#D3B684");
|
||||
|
||||
final List<int> years = List.generate(100, (i) => DateTime.now().year - i)
|
||||
..sort();
|
||||
final List<int> months = List.generate(12, (i) => i + 1);
|
||||
final List<int> days = List.generate(31, (i) => i + 1);
|
||||
|
||||
final RxList<int> daysSelect = <int>[].obs;
|
||||
|
||||
final RxInt yearIndex = years.indexOf(checkDate.year).obs;
|
||||
final RxInt monthIndex = months.indexOf(checkDate.month).obs;
|
||||
final RxInt dayIndex = days.indexOf(checkDate.day).obs;
|
||||
|
||||
void updateDays() {
|
||||
final int daysInMonth =
|
||||
DateTime(years[yearIndex.value], months[monthIndex.value] + 1, 0).day;
|
||||
daysSelect.value = days.sublist(0, daysInMonth);
|
||||
if (dayIndex.value >= daysInMonth) {
|
||||
dayIndex.value = daysInMonth - 1;
|
||||
}
|
||||
}
|
||||
for (var i = 1; i < 13; i++) {
|
||||
months.add(i);
|
||||
}
|
||||
for (var i = 1; i < 32; i++) {
|
||||
days.add(i);
|
||||
}
|
||||
int yearIndex = years.lastIndexOf(checkDate.year);
|
||||
int monthIndex = months.lastIndexOf(checkDate.month);
|
||||
day_len = DateTime.fromMillisecondsSinceEpoch(
|
||||
DateTime(years[yearIndex], months[monthIndex] + 1)
|
||||
.millisecondsSinceEpoch -
|
||||
1000)
|
||||
.day;
|
||||
days_select.value = days.sublist(0, day_len);
|
||||
int dayIndex = days.lastIndexOf(checkDate.day);
|
||||
|
||||
updateDays();
|
||||
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true, // 点击对话框外部可关闭
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 0, // 控制弹窗距离顶部的位置
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Material(
|
||||
@@ -53,151 +353,145 @@ Future showDateSelectionDialog(BuildContext context,
|
||||
),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(
|
||||
AppConstants().normal_container_radius),
|
||||
topRight: Radius.circular(
|
||||
AppConstants().normal_container_radius),
|
||||
bottomLeft: Radius.circular(0.rpx),
|
||||
bottomRight: Radius.circular(0.rpx),
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.fromLTRB(30.rpx, 10.rpx, 30.rpx, 90.rpx),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
color: themeController.currentColor.sc5,
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 80.rpx,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 30.rpx, right: 30.rpx),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
InkWell(
|
||||
child: Text(
|
||||
"日期.取消".tr,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.zero,
|
||||
onTap: () => Navigator.of(context).pop(),
|
||||
child: Container(
|
||||
width: 110.rpx,
|
||||
height: 60.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text("取消".tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
Text(
|
||||
"$title",
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize:
|
||||
AppConstants().title_text_fontSize),
|
||||
),
|
||||
// closeIconWhite,
|
||||
InkWell(
|
||||
child: Text(
|
||||
"日期.确定".tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc2,
|
||||
letterSpacing: 0,
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize),
|
||||
),
|
||||
onTap: () {
|
||||
checkChange?.call(DateTime(years[yearIndex],
|
||||
months[monthIndex], days[dayIndex]));
|
||||
Get.back();
|
||||
},
|
||||
)
|
||||
],
|
||||
fontSize: 30.rpx, color: Colors.white)),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.zero,
|
||||
onTap: () {
|
||||
final selectedDate = DateTime(
|
||||
years[yearIndex.value],
|
||||
months[monthIndex.value],
|
||||
daysSelect[dayIndex.value],
|
||||
);
|
||||
checkChange?.call(selectedDate);
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
width: 110.rpx,
|
||||
height: 60.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text("确定".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: themeController.currentColor.sc2,
|
||||
)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 240.rpx,
|
||||
margin: EdgeInsets.only(top: 60.rpx, bottom: 60.rpx),
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center, // ✅ 整体居中
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 120.rpx,
|
||||
child: getOnePicker(context, years, yearIndex,
|
||||
(d) {
|
||||
yearIndex = d;
|
||||
dayIndex = 0;
|
||||
day_len =
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
DateTime(
|
||||
years[yearIndex],
|
||||
months[monthIndex] +
|
||||
1)
|
||||
.millisecondsSinceEpoch -
|
||||
1000)
|
||||
.day;
|
||||
days_select.value =
|
||||
days.sublist(0, day_len);
|
||||
}, "年".tr),
|
||||
SizedBox(height: 20.rpx),
|
||||
Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: IgnorePointer(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: 90.rpx,
|
||||
margin:
|
||||
EdgeInsets.symmetric(horizontal: 70.rpx),
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc2,
|
||||
borderRadius: BorderRadius.circular(16.rpx),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(width: 100.rpx),
|
||||
|
||||
// 月
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 80.rpx,
|
||||
child: getOnePicker(
|
||||
context, months, monthIndex, (d) {
|
||||
monthIndex = d;
|
||||
dayIndex = 0;
|
||||
day_len =
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
DateTime(
|
||||
years[yearIndex],
|
||||
months[monthIndex] +
|
||||
1)
|
||||
.millisecondsSinceEpoch -
|
||||
1000)
|
||||
.day;
|
||||
days_select.value =
|
||||
days.sublist(0, day_len);
|
||||
}, "月".tr),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 240.rpx,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 95.rpx),
|
||||
child: Row(
|
||||
children: isEn
|
||||
? [
|
||||
Expanded(
|
||||
child: getOnePickers(
|
||||
context,
|
||||
months,
|
||||
monthIndex,
|
||||
isMonthName: true,
|
||||
onChanged: (_) => updateDays(),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: getOnePickers(
|
||||
context,
|
||||
daysSelect,
|
||||
dayIndex,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: getOnePickers(
|
||||
context,
|
||||
years,
|
||||
yearIndex,
|
||||
onChanged: (_) => updateDays(),
|
||||
),
|
||||
),
|
||||
]
|
||||
: [
|
||||
Expanded(
|
||||
child: getOnePickers(
|
||||
context,
|
||||
years,
|
||||
yearIndex,
|
||||
unit: "年",
|
||||
onChanged: (_) => updateDays(),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: getOnePickers(
|
||||
context,
|
||||
months,
|
||||
monthIndex,
|
||||
unit: "月",
|
||||
onChanged: (_) => updateDays(),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: getOnePickers(
|
||||
context,
|
||||
daysSelect,
|
||||
dayIndex,
|
||||
unit: "日",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(width: 100.rpx),
|
||||
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 80.rpx,
|
||||
child: Obx(() {
|
||||
return getOnePicker(
|
||||
context, days_select, dayIndex, (d) {
|
||||
dayIndex = d;
|
||||
}, "日".tr);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -426,7 +426,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
child: Center(
|
||||
child: Text(
|
||||
personController.dateTime != null
|
||||
? DateFormat("yyyy年MM月dd日").format(
|
||||
? DateFormat("yyyy/MM/dd").format(
|
||||
personController.dateTime!)
|
||||
: '人员资料.生日输入提示'.tr,
|
||||
textAlign: TextAlign.right,
|
||||
@@ -494,7 +494,8 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
child: Center(
|
||||
child: Text(
|
||||
personController.height.value != ""
|
||||
? personController.height.value
|
||||
? personController.height.value +
|
||||
"cm".tr
|
||||
: '身高输入提示'.tr,
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
@@ -555,7 +556,8 @@ class _UpdatePageState extends State<UpdatePersonPage> {
|
||||
child: Center(
|
||||
child: Text(
|
||||
personController.weight.value != ""
|
||||
? personController.weight.value
|
||||
? personController.weight.value +
|
||||
"kg".tr
|
||||
: '人员资料.体重输入提示'.tr,
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
|
||||
159
lib/pages/setting/Theme_setting.dart
Normal file
159
lib/pages/setting/Theme_setting.dart
Normal file
@@ -0,0 +1,159 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.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/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/model/CustomThemeColor.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/FancyCircleCheckbox.dart';
|
||||
|
||||
class ThemeSetting extends StatefulWidget {
|
||||
const ThemeSetting({super.key});
|
||||
|
||||
@override
|
||||
State<ThemeSetting> createState() => _ThemeSettingState();
|
||||
}
|
||||
|
||||
class _ThemeSettingState extends State<ThemeSetting> {
|
||||
ThemeController themeController = Get.find();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// 主题选项
|
||||
final List<Map<String, dynamic>> themes = [
|
||||
{
|
||||
'name': '浅色主题'.tr,
|
||||
'value': CustomThemeColor.light,
|
||||
},
|
||||
{
|
||||
'name': '深色主题'.tr,
|
||||
'value': CustomThemeColor.dark,
|
||||
},
|
||||
];
|
||||
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/img/bgNoImg.png'),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
backgroundColor: themeController.currentColor.sc17,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
titleSpacing: 0,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'选择主题'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtom,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
centerTitle: false,
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
SizedBox(height: 25.rpx),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF242835),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().normal_container_radius),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 20.rpx),
|
||||
child: Column(
|
||||
children: themes
|
||||
.map<Widget>((theme) {
|
||||
bool isSelected =
|
||||
themeController.currentColor ==
|
||||
theme['value'];
|
||||
return ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor:
|
||||
themeController.currentColor.sc21,
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.rpx, horizontal: 16.rpx),
|
||||
onTap: () async {
|
||||
// 切换主题
|
||||
themeController
|
||||
.changeTheme(theme['value']);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
theme['name'],
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
fontSize: AppConstants()
|
||||
.title_text_fontSize,
|
||||
),
|
||||
),
|
||||
FancyCircleCheckbox(
|
||||
borderColor:
|
||||
themeController.currentColor.sc3,
|
||||
fillColor:
|
||||
themeController.currentColor.sc2,
|
||||
value: isSelected,
|
||||
onChanged: (value) {
|
||||
themeController
|
||||
.changeTheme(theme['value']);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
})
|
||||
.toList()
|
||||
.divide(
|
||||
SizedBox(height: 30.rpx),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -266,8 +266,7 @@ class _CommonMessageSettingPageState extends State<CommonMessageSettingPage> {
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc5,
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().normal_container_radius),
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
@@ -632,7 +631,7 @@ class _CommonMessageSettingPageState extends State<CommonMessageSettingPage> {
|
||||
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 30.rpx, 0, 0),
|
||||
EdgeInsetsDirectional.fromSTEB(0, 21.rpx, 0, 0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(
|
||||
@@ -760,7 +759,7 @@ class _CommonMessageSettingPageState extends State<CommonMessageSettingPage> {
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 30.rpx, 0, 0),
|
||||
EdgeInsetsDirectional.fromSTEB(0, 21.rpx, 0, 0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(
|
||||
|
||||
@@ -13,6 +13,7 @@ import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/date/CalendarController.dart';
|
||||
import 'package:vbvs_app/controller/sleep/sleep_report_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/language/AppLanguage.dart';
|
||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
||||
@@ -113,7 +114,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
_initSleepReportData();
|
||||
});
|
||||
|
||||
double lineWidth = 115.rpx;
|
||||
double lineWidth = 150.rpx;
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
onHorizontalDragEnd: _handleHorizontalDrag, // 添加水平滑动检测
|
||||
@@ -228,7 +229,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
children: [
|
||||
Container(
|
||||
width:
|
||||
115.rpx, // 固定宽度为 160.rpx
|
||||
150.rpx, // 固定宽度为 160.rpx
|
||||
alignment:
|
||||
Alignment.center, // 文字居中
|
||||
child: Text(
|
||||
@@ -267,7 +268,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: 115
|
||||
width: 150
|
||||
.rpx, // 固定宽度为 160.rpx
|
||||
alignment: Alignment
|
||||
.center, // 文字居中
|
||||
@@ -309,7 +310,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: 115
|
||||
width: 150
|
||||
.rpx, // 固定宽度为 160.rpx
|
||||
alignment: Alignment
|
||||
.center, // 文字居中
|
||||
@@ -352,8 +353,8 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
: sleepReportController
|
||||
.model.type ==
|
||||
2
|
||||
? 115.rpx
|
||||
: 230.rpx,
|
||||
? 150.rpx
|
||||
: 300.rpx,
|
||||
child: Container(
|
||||
width: lineWidth,
|
||||
height: 4.rpx,
|
||||
@@ -390,172 +391,79 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
widget.data['backgroundColor'] != null
|
||||
? widget.data['backgroundColor']
|
||||
: themeController.currentColor.sc5,
|
||||
highlightColor: themeController
|
||||
.currentColor.sc5, // 或你希望的点击水波纹颜色
|
||||
borderRadius: AppConstants()
|
||||
.normal_container_radius, // 如果你想加圆角可以设置 eg. 12.rpx
|
||||
highlightColor: themeController.currentColor.sc5,
|
||||
borderRadius:
|
||||
AppConstants().normal_container_radius,
|
||||
padding: EdgeInsets.zero,
|
||||
onTap: () {},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 0.rpx),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// 左侧信息列 (姓名、年龄)
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
16.rpx, 0, 0, 0),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'姓名'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'年龄'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
].divide(
|
||||
SizedBox(height: 34.rpx)),
|
||||
_buildBaselineRow(
|
||||
label: '姓名'.tr,
|
||||
value: (widget.data['person']
|
||||
?['name']
|
||||
?.toString()
|
||||
.trim()
|
||||
.isNotEmpty ??
|
||||
false)
|
||||
? widget
|
||||
.data['person']!['name']
|
||||
.toString()
|
||||
: '未知数据'.tr,
|
||||
themeController: themeController,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
(widget.data['person']
|
||||
?['name']
|
||||
?.toString()
|
||||
.trim()
|
||||
.isNotEmpty ??
|
||||
false)
|
||||
? widget.data['person']![
|
||||
'name']
|
||||
.toString()
|
||||
: '未知数据'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
SizedBox(height: 34.rpx),
|
||||
_buildBaselineRow(
|
||||
label: '年龄'.tr,
|
||||
value:
|
||||
'${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(
|
||||
SizedBox(height: 34.rpx)),
|
||||
themeController: themeController,
|
||||
),
|
||||
]
|
||||
.divide(SizedBox(width: 33.rpx))
|
||||
.addToStart(
|
||||
SizedBox(width: 37.rpx)),
|
||||
],
|
||||
),
|
||||
]
|
||||
.addToStart(SizedBox(height: 36.rpx))
|
||||
.addToEnd(SizedBox(height: 36.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
|
||||
// 右侧信息列 (设备ID、体重)
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
16.rpx, 36.rpx, 0, 36.rpx),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'设备ID'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'体重'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
].divide(
|
||||
SizedBox(height: 34.rpx)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
_buildBaselineRow(
|
||||
label: '设备ID'.tr,
|
||||
value:
|
||||
'${widget.data['code'] ?? widget.data['mac']}',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
'${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(
|
||||
SizedBox(height: 34.rpx)),
|
||||
themeController: themeController,
|
||||
),
|
||||
]
|
||||
.divide(SizedBox(width: 33.rpx))
|
||||
.addToStart(
|
||||
SizedBox(width: 37.rpx)),
|
||||
SizedBox(height: 34.rpx),
|
||||
_buildBaselineRow(
|
||||
label: '体重'.tr,
|
||||
value:
|
||||
'${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
|
||||
themeController: themeController,
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
||||
.addToStart(SizedBox(height: 36.rpx))
|
||||
.addToEnd(SizedBox(height: 36.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -652,8 +560,8 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
: sleepReportController
|
||||
.model.type ==
|
||||
2
|
||||
? 115.rpx
|
||||
: 230.rpx,
|
||||
? 150.rpx
|
||||
: 300.rpx,
|
||||
child: Container(
|
||||
width: lineWidth,
|
||||
height: 4.rpx,
|
||||
@@ -699,165 +607,222 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Flexible(
|
||||
// Flexible(
|
||||
// flex: 2,
|
||||
// child: Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Row(
|
||||
// children: [
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.end,
|
||||
// children: [
|
||||
// Text(
|
||||
// '姓名'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController
|
||||
// .currentColor.sc4,
|
||||
// ),
|
||||
// ),
|
||||
// Text(
|
||||
// '年龄'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController
|
||||
// .currentColor.sc4,
|
||||
// ),
|
||||
// ),
|
||||
// ].divide(
|
||||
// SizedBox(height: 34.rpx)),
|
||||
// ),
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text(
|
||||
// (widget.data['person']
|
||||
// ?['name']
|
||||
// ?.toString()
|
||||
// .trim()
|
||||
// .isNotEmpty ??
|
||||
// false)
|
||||
// ? widget
|
||||
// .data['person']![
|
||||
// 'name']
|
||||
// .toString()
|
||||
// : '未知数据'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController
|
||||
// .currentColor.sc3,
|
||||
// ),
|
||||
// ),
|
||||
// Text(
|
||||
// '${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController
|
||||
// .currentColor.sc3,
|
||||
// ),
|
||||
// ),
|
||||
// ].divide(
|
||||
// SizedBox(height: 34.rpx)),
|
||||
// ),
|
||||
// ]
|
||||
// .divide(SizedBox(width: 33.rpx))
|
||||
// .addToStart(
|
||||
// SizedBox(width: 37.rpx)),
|
||||
// ),
|
||||
// ]
|
||||
// .addToStart(
|
||||
// SizedBox(height: 36.rpx))
|
||||
// .addToEnd(SizedBox(height: 36.rpx)),
|
||||
// ),
|
||||
// ),
|
||||
// Flexible(
|
||||
// flex: 3,
|
||||
// child: Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Row(
|
||||
// children: [
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.end,
|
||||
// children: [
|
||||
// Text(
|
||||
// '设备ID'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController
|
||||
// .currentColor.sc4,
|
||||
// ),
|
||||
// ),
|
||||
// Text(
|
||||
// '体重'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController
|
||||
// .currentColor.sc4,
|
||||
// ),
|
||||
// ),
|
||||
// ].divide(
|
||||
// SizedBox(height: 34.rpx)),
|
||||
// ),
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text(
|
||||
// // '${widget.data['code'] ?? '未知数据'.tr}',
|
||||
// '${widget.data['code'] ?? widget.data['mac']}',
|
||||
// // "D11250300003",
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController
|
||||
// .currentColor.sc3,
|
||||
// ),
|
||||
// maxLines: 1,
|
||||
// overflow:
|
||||
// TextOverflow.ellipsis,
|
||||
// ),
|
||||
// Text(
|
||||
// '${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController
|
||||
// .currentColor.sc3,
|
||||
// ),
|
||||
// ),
|
||||
// ].divide(
|
||||
// SizedBox(height: 34.rpx)),
|
||||
// ),
|
||||
// ]
|
||||
// .divide(SizedBox(width: 33.rpx))
|
||||
// .addToStart(
|
||||
// SizedBox(width: 37.rpx)),
|
||||
// ),
|
||||
// ]
|
||||
// .addToStart(
|
||||
// SizedBox(height: 36.rpx))
|
||||
// .addToEnd(SizedBox(height: 36.rpx)),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'姓名'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'年龄'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
].divide(
|
||||
SizedBox(height: 34.rpx)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
(widget.data['person']
|
||||
?['name']
|
||||
?.toString()
|
||||
.trim()
|
||||
.isNotEmpty ??
|
||||
false)
|
||||
? widget
|
||||
.data['person']![
|
||||
'name']
|
||||
.toString()
|
||||
: '未知数据'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(
|
||||
SizedBox(height: 34.rpx)),
|
||||
),
|
||||
]
|
||||
.divide(SizedBox(width: 33.rpx))
|
||||
.addToStart(
|
||||
SizedBox(width: 37.rpx)),
|
||||
),
|
||||
]
|
||||
.addToStart(
|
||||
SizedBox(height: 36.rpx))
|
||||
.addToEnd(SizedBox(height: 36.rpx)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
16.rpx, 0, 0, 0),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildBaselineRow(
|
||||
label: '姓名'.tr,
|
||||
value: (widget.data['person']
|
||||
?['name']
|
||||
?.toString()
|
||||
.trim()
|
||||
.isNotEmpty ??
|
||||
false)
|
||||
? widget
|
||||
.data['person']!['name']
|
||||
.toString()
|
||||
: '未知数据'.tr,
|
||||
themeController: themeController,
|
||||
),
|
||||
SizedBox(height: 34.rpx),
|
||||
_buildBaselineRow(
|
||||
label: '年龄'.tr,
|
||||
value:
|
||||
'${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
|
||||
themeController: themeController,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'设备ID'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'体重'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
].divide(
|
||||
SizedBox(height: 34.rpx)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
// '${widget.data['code'] ?? '未知数据'.tr}',
|
||||
'${widget.data['code'] ?? widget.data['mac']}',
|
||||
// "D11250300003",
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
'${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(
|
||||
SizedBox(height: 34.rpx)),
|
||||
),
|
||||
]
|
||||
.divide(SizedBox(width: 33.rpx))
|
||||
.addToStart(
|
||||
SizedBox(width: 37.rpx)),
|
||||
),
|
||||
]
|
||||
.addToStart(
|
||||
SizedBox(height: 36.rpx))
|
||||
.addToEnd(SizedBox(height: 36.rpx)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
16.rpx, 36.rpx, 0, 36.rpx),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildBaselineRow(
|
||||
label: '设备ID'.tr,
|
||||
value:
|
||||
'${widget.data['code'] ?? widget.data['mac']}',
|
||||
themeController: themeController,
|
||||
),
|
||||
SizedBox(height: 34.rpx),
|
||||
_buildBaselineRow(
|
||||
label: '体重'.tr,
|
||||
value:
|
||||
'${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
|
||||
themeController: themeController,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -1382,7 +1347,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: 115.rpx,
|
||||
width: 150.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
title.tr,
|
||||
@@ -1478,4 +1443,42 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
loadSleepReport(newType);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildBaselineRow({
|
||||
required String label,
|
||||
required String value,
|
||||
required ThemeController themeController,
|
||||
}) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
children: [
|
||||
// 描述(label)
|
||||
SizedBox(
|
||||
width: 100.rpx,
|
||||
child: Text(
|
||||
label,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 16.rpx),
|
||||
// 值(value)
|
||||
Expanded(
|
||||
child: Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,8 +121,9 @@ class _SettingPageState extends State<SettingPage> {
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(
|
||||
// 40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
||||
// onTap: () {
|
||||
// TopSlideNotification.show(context,
|
||||
// text: "待开发功能".tr);
|
||||
// // TopSlideNotification.show(context,
|
||||
// // text: "待开发功能".tr);
|
||||
// Get.toNamed("/themeSetting");
|
||||
// },
|
||||
// child: Container(
|
||||
// child: Padding(
|
||||
|
||||
Reference in New Issue
Block a user