设备分享
This commit is contained in:
@@ -318,6 +318,7 @@ class _DeviceSharePageState extends State<DeviceSharePage> {
|
|||||||
text: apiResponse.msg!,
|
text: apiResponse.msg!,
|
||||||
textColor: themeController.currentColor.sc9);
|
textColor: themeController.currentColor.sc9);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
colors: [
|
colors: [
|
||||||
// 渐变色
|
// 渐变色
|
||||||
@@ -350,56 +351,6 @@ class _DeviceSharePageState extends State<DeviceSharePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Padding(
|
|
||||||
// padding:
|
|
||||||
// EdgeInsetsDirectional.fromSTEB(0, 379.rpx, 0, 0),
|
|
||||||
// child: CustomCard(
|
|
||||||
// borderRadius:
|
|
||||||
// AppConstants().button_container_radius, // 圆角半径
|
|
||||||
// onTap: () async {
|
|
||||||
// // TopSlideNotification.show(context,
|
|
||||||
// // text: "待开发功能".tr);
|
|
||||||
// LoginController loginController = Get.find();
|
|
||||||
// // loginController.fluwx.share(WeChatShareTextModel(
|
|
||||||
// // "太和e护分享链接",
|
|
||||||
// // scene: WeChatScene.session));
|
|
||||||
// final Uint8List data = await rootBundle.load('assets/img/camera.png').then((bd) => bd.buffer.asUint8List());
|
|
||||||
// loginController.fluwx.share(WeChatShareWebPageModel("taihecare://goods?id=123",title: "标题",description: "描述",thumbData: data));
|
|
||||||
// },
|
|
||||||
// colors: [
|
|
||||||
// // 渐变色
|
|
||||||
// themeController.currentColor.sc1,
|
|
||||||
// themeController.currentColor.sc2,
|
|
||||||
// ],
|
|
||||||
// child: Container(
|
|
||||||
// width: MediaQuery.sizeOf(context).width * 0.66,
|
|
||||||
// height: MediaQuery.sizeOf(context).height * 0.055,
|
|
||||||
// constraints: BoxConstraints(
|
|
||||||
// minWidth: 500.rpx,
|
|
||||||
// minHeight: 90.rpx,
|
|
||||||
// ),
|
|
||||||
// child: Row(
|
|
||||||
// mainAxisSize: MainAxisSize.max,
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// '微信好友一键分享'.tr,
|
|
||||||
// style: FlutterFlowTheme.of(context)
|
|
||||||
// .bodyMedium
|
|
||||||
// .override(
|
|
||||||
// color: themeController.currentColor.sc3,
|
|
||||||
// fontFamily: 'Inter',
|
|
||||||
// fontSize: AppConstants()
|
|
||||||
// .normal_text_fontSize, // 自定义字体大小
|
|
||||||
// letterSpacing: 0.0,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ].divide(SizedBox(width: 17.rpx)),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -22,12 +22,17 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
|
|||||||
final _formKey = GlobalKey<FormState>();
|
final _formKey = GlobalKey<FormState>();
|
||||||
final _phoneController = TextEditingController();
|
final _phoneController = TextEditingController();
|
||||||
|
|
||||||
|
fetchData() async {
|
||||||
|
await controller.shareDeviceList(data["mac"]);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
controller.model.msg = "";
|
controller.model.msg = "";
|
||||||
controller.model.code = 0;
|
controller.model.code = 0;
|
||||||
controller.model.type = 1;
|
controller.model.type = 1;
|
||||||
controller.model.account = '';
|
controller.model.account = '';
|
||||||
|
fetchData();
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
// onTap: () => FocusScope.of(context).unfocus(),,
|
// onTap: () => FocusScope.of(context).unfocus(),,
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -278,135 +283,6 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Obx(
|
|
||||||
// () => GestureDetector(
|
|
||||||
// onTap: () {
|
|
||||||
// controller.model.type = 2;
|
|
||||||
// controller.updateAll();
|
|
||||||
// },
|
|
||||||
// child: Container(
|
|
||||||
// width: MediaQuery.sizeOf(context).width,
|
|
||||||
// constraints: const BoxConstraints(
|
|
||||||
// minHeight: 46,
|
|
||||||
// ),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// borderRadius:
|
|
||||||
// BorderRadius.circular(0),
|
|
||||||
// ),
|
|
||||||
// child: Row(
|
|
||||||
// mainAxisSize: MainAxisSize.max,
|
|
||||||
// mainAxisAlignment:
|
|
||||||
// MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// '仅允许对方查看该设备'.tr,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontFamily: 'Readex Pro',
|
|
||||||
// color: Colors.white,
|
|
||||||
// fontSize: 26.rpx,
|
|
||||||
// letterSpacing: 0.0,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// // Theme(
|
|
||||||
// // data:
|
|
||||||
// // Theme.of(context).copyWith(
|
|
||||||
// // unselectedWidgetColor: Color(
|
|
||||||
// // 0xFFC8CBD2), // 改变未选中状态边框颜色
|
|
||||||
// // ),
|
|
||||||
// // child: Radio<int>(
|
|
||||||
// // value: 2,
|
|
||||||
// // groupValue:
|
|
||||||
// // controller.model.type,
|
|
||||||
// // onChanged: (value) {
|
|
||||||
// // controller.model.type =
|
|
||||||
// // value!;
|
|
||||||
// // controller.updateAll();
|
|
||||||
// // },
|
|
||||||
// // activeColor:
|
|
||||||
// // const Color(0xFF6BFDAC),
|
|
||||||
// // materialTapTargetSize:
|
|
||||||
// // MaterialTapTargetSize
|
|
||||||
// // .shrinkWrap, // 减少内边距
|
|
||||||
// // visualDensity: VisualDensity(
|
|
||||||
// // horizontal: -4,
|
|
||||||
// // vertical: -4), // 缩小视觉密度
|
|
||||||
// // ))
|
|
||||||
// ClipOval(
|
|
||||||
// child: Container(
|
|
||||||
// height:
|
|
||||||
// MediaQuery.sizeOf(context)
|
|
||||||
// .height *
|
|
||||||
// 0.0449,
|
|
||||||
// child: AspectRatio(
|
|
||||||
// aspectRatio: 1,
|
|
||||||
// child: Center(
|
|
||||||
// child: LayoutBuilder(
|
|
||||||
// builder: (context,
|
|
||||||
// constraints) {
|
|
||||||
// double h =
|
|
||||||
// MediaQuery.sizeOf(
|
|
||||||
// context)
|
|
||||||
// .height *
|
|
||||||
// 0.0326;
|
|
||||||
// bool check = controller
|
|
||||||
// .model.type ==
|
|
||||||
// 2;
|
|
||||||
// if (check) {
|
|
||||||
// return Container(
|
|
||||||
// height: h,
|
|
||||||
// width: h,
|
|
||||||
// decoration:
|
|
||||||
// BoxDecoration(
|
|
||||||
// borderRadius:
|
|
||||||
// BorderRadius
|
|
||||||
// .circular(
|
|
||||||
// h / 2),
|
|
||||||
// border: Border.all(
|
|
||||||
// width: 1,
|
|
||||||
// color: Color(
|
|
||||||
// 0xFF6BFDAC)),
|
|
||||||
// ),
|
|
||||||
// child: Center(
|
|
||||||
// child: ClipOval(
|
|
||||||
// child: Container(
|
|
||||||
// width:
|
|
||||||
// h * 0.6,
|
|
||||||
// height:
|
|
||||||
// h * 0.6,
|
|
||||||
// color: Color(
|
|
||||||
// 0xFF6BFDAC)),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// } else {
|
|
||||||
// return Container(
|
|
||||||
// height: h,
|
|
||||||
// width: h,
|
|
||||||
// decoration:
|
|
||||||
// BoxDecoration(
|
|
||||||
// borderRadius:
|
|
||||||
// BorderRadius
|
|
||||||
// .circular(
|
|
||||||
// h / 2),
|
|
||||||
// border: Border.all(
|
|
||||||
// width: 0.5,
|
|
||||||
// color: Colors
|
|
||||||
// .white),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.model.type = 2;
|
controller.model.type = 2;
|
||||||
@@ -476,7 +352,6 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0, 0),
|
alignment: const AlignmentDirectional(0, 0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
@@ -309,155 +309,38 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
|||||||
),
|
),
|
||||||
getLine(),
|
getLine(),
|
||||||
Obx(
|
Obx(
|
||||||
() => Container(
|
() => InkWell(
|
||||||
|
onTap: () {
|
||||||
|
// 延迟执行的代码
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(
|
||||||
|
FocusNode());
|
||||||
|
Future.delayed(
|
||||||
|
const Duration(
|
||||||
|
milliseconds: 250),
|
||||||
|
() {
|
||||||
|
showOneSelectionDialog(
|
||||||
|
context,
|
||||||
|
arr: ["女", "男"],
|
||||||
|
checkIndex: controller
|
||||||
|
.model
|
||||||
|
.peopleList[
|
||||||
|
index]['gender'],
|
||||||
|
checkChange: (sindex) {
|
||||||
|
controller.model.peopleList[
|
||||||
|
index]['gender'] =
|
||||||
|
sindex; // 👈 保存为 0 / 1
|
||||||
|
controller.updateAll();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
margin: EdgeInsets.only(
|
margin: EdgeInsets.only(
|
||||||
left: 40.rpx,
|
left: 40.rpx,
|
||||||
right: 35.rpx),
|
right: 35.rpx),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 90.rpx,
|
height: 90.rpx,
|
||||||
decoration: BoxDecoration(),
|
decoration: BoxDecoration(),
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
// 延迟执行的代码
|
|
||||||
FocusScope.of(context)
|
|
||||||
.requestFocus(
|
|
||||||
FocusNode());
|
|
||||||
Future.delayed(
|
|
||||||
const Duration(
|
|
||||||
milliseconds:
|
|
||||||
250), () {
|
|
||||||
showOneSelectionDialog(
|
|
||||||
context,
|
|
||||||
arr: ["女", "男"],
|
|
||||||
checkIndex: controller
|
|
||||||
.model
|
|
||||||
.peopleList[index]
|
|
||||||
[
|
|
||||||
'gender'] ==
|
|
||||||
"女"
|
|
||||||
? 0
|
|
||||||
: 1,
|
|
||||||
checkChange:
|
|
||||||
(sindex) {
|
|
||||||
controller.model.peopleList[
|
|
||||||
index]
|
|
||||||
['gender'] =
|
|
||||||
sindex; // 👈 保存为 0 / 1
|
|
||||||
controller
|
|
||||||
.updateAll();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.max,
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment
|
|
||||||
.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'性别',
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily:
|
|
||||||
'Readex Pro',
|
|
||||||
color: Color(
|
|
||||||
0xFF9EA4B7),
|
|
||||||
fontSize: 30.rpx,
|
|
||||||
letterSpacing: 0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width: 200.rpx,
|
|
||||||
child: Text(
|
|
||||||
'${controller.model.peopleList[index]['gender'] == 1 ? '男' : '女'}',
|
|
||||||
textAlign:
|
|
||||||
TextAlign
|
|
||||||
.right,
|
|
||||||
style:
|
|
||||||
TextStyle(
|
|
||||||
fontFamily:
|
|
||||||
'Readex Pro',
|
|
||||||
color: Colors
|
|
||||||
.white,
|
|
||||||
fontSize:
|
|
||||||
30.rpx,
|
|
||||||
letterSpacing:
|
|
||||||
0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 16.rpx,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 30.rpx,
|
|
||||||
width: 30.rpx,
|
|
||||||
child:
|
|
||||||
SvgPicture
|
|
||||||
.asset(
|
|
||||||
'assets/img/icon/expand_more.svg',
|
|
||||||
color: Colors
|
|
||||||
.white,
|
|
||||||
))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
getLine(),
|
|
||||||
Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 90.rpx,
|
|
||||||
margin: EdgeInsets.only(
|
|
||||||
left: 40.rpx,
|
|
||||||
right: 35.rpx),
|
|
||||||
decoration: BoxDecoration(),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
// Convert string height to int for initial value
|
|
||||||
final currentHeight =
|
|
||||||
controller.model
|
|
||||||
.peopleList[
|
|
||||||
index]['height'];
|
|
||||||
final initialHeight =
|
|
||||||
currentHeight != null
|
|
||||||
? int.tryParse(
|
|
||||||
currentHeight
|
|
||||||
.toString()) ??
|
|
||||||
170
|
|
||||||
: 170;
|
|
||||||
|
|
||||||
FocusScope.of(context)
|
|
||||||
.requestFocus(
|
|
||||||
FocusNode());
|
|
||||||
Future.delayed(
|
|
||||||
const Duration(
|
|
||||||
milliseconds: 250),
|
|
||||||
() {
|
|
||||||
showHeightPickerDialog(
|
|
||||||
context,
|
|
||||||
initialHeight:
|
|
||||||
initialHeight,
|
|
||||||
onConfirm: (int
|
|
||||||
selectedHeight) {
|
|
||||||
controller.model.peopleList[
|
|
||||||
index]
|
|
||||||
['height'] =
|
|
||||||
selectedHeight
|
|
||||||
.toString();
|
|
||||||
controller
|
|
||||||
.updateAll();
|
|
||||||
print(
|
|
||||||
"身高: $selectedHeight cm");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize:
|
mainAxisSize:
|
||||||
MainAxisSize.max,
|
MainAxisSize.max,
|
||||||
@@ -466,7 +349,205 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
|||||||
.spaceBetween,
|
.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'身高(cm)',
|
'性别',
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color:
|
||||||
|
Color(0xFF9EA4B7),
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisSize:
|
||||||
|
MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 200.rpx,
|
||||||
|
child: Text(
|
||||||
|
controller.model.peopleList[
|
||||||
|
index]
|
||||||
|
[
|
||||||
|
'gender'] ==
|
||||||
|
0
|
||||||
|
? '女'
|
||||||
|
: '男',
|
||||||
|
textAlign:
|
||||||
|
TextAlign
|
||||||
|
.right,
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color: Colors
|
||||||
|
.white,
|
||||||
|
fontSize:
|
||||||
|
30.rpx,
|
||||||
|
letterSpacing:
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 16.rpx,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 30.rpx,
|
||||||
|
width: 30.rpx,
|
||||||
|
child: SvgPicture
|
||||||
|
.asset(
|
||||||
|
'assets/img/icon/expand_more.svg',
|
||||||
|
color: Colors
|
||||||
|
.white,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
getLine(),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
// Convert string height to int for initial value
|
||||||
|
final currentHeight = controller
|
||||||
|
.model.peopleList[index]
|
||||||
|
['height'];
|
||||||
|
final initialHeight =
|
||||||
|
currentHeight != null
|
||||||
|
? int.tryParse(
|
||||||
|
currentHeight
|
||||||
|
.toString()) ??
|
||||||
|
170
|
||||||
|
: 170;
|
||||||
|
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(FocusNode());
|
||||||
|
Future.delayed(
|
||||||
|
const Duration(
|
||||||
|
milliseconds: 250), () {
|
||||||
|
showHeightPickerDialog(
|
||||||
|
context,
|
||||||
|
initialHeight:
|
||||||
|
initialHeight,
|
||||||
|
onConfirm:
|
||||||
|
(int selectedHeight) {
|
||||||
|
controller.model.peopleList[
|
||||||
|
index]['height'] =
|
||||||
|
selectedHeight
|
||||||
|
.toString();
|
||||||
|
controller.updateAll();
|
||||||
|
print(
|
||||||
|
"身高: $selectedHeight cm");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 90.rpx,
|
||||||
|
margin: EdgeInsets.only(
|
||||||
|
left: 40.rpx,
|
||||||
|
right: 35.rpx),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize:
|
||||||
|
MainAxisSize.max,
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'身高(cm)',
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color:
|
||||||
|
Color(0xFF9EA4B7),
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
controller.model.peopleList[
|
||||||
|
index]
|
||||||
|
[
|
||||||
|
'height'] !=
|
||||||
|
null
|
||||||
|
? "${controller.model.peopleList[index]['height']} cm"
|
||||||
|
: '',
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily:
|
||||||
|
'Readex Pro',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 16.rpx),
|
||||||
|
Container(
|
||||||
|
height: 30.rpx,
|
||||||
|
width: 30.rpx,
|
||||||
|
child: SvgPicture
|
||||||
|
.asset(
|
||||||
|
'assets/img/icon/expand_more.svg',
|
||||||
|
color:
|
||||||
|
Colors.white,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
getLine(),
|
||||||
|
Obx(
|
||||||
|
() => InkWell(
|
||||||
|
onTap: () {
|
||||||
|
FocusScope.of(context)
|
||||||
|
.requestFocus(
|
||||||
|
FocusNode());
|
||||||
|
Future.delayed(
|
||||||
|
const Duration(
|
||||||
|
milliseconds: 250),
|
||||||
|
() {
|
||||||
|
showWeightPickerDialog(
|
||||||
|
context,
|
||||||
|
initialWeight: controller
|
||||||
|
.model
|
||||||
|
.peopleList[
|
||||||
|
index]['weight'] ??
|
||||||
|
"",
|
||||||
|
onConfirm:
|
||||||
|
(int selectedWeight) {
|
||||||
|
controller.model
|
||||||
|
.peopleList[
|
||||||
|
index]['weight'] =
|
||||||
|
selectedWeight
|
||||||
|
.toString(); // ✅ 转成字符串
|
||||||
|
controller.updateAll();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 90.rpx,
|
||||||
|
margin: EdgeInsets.only(
|
||||||
|
left: 40.rpx,
|
||||||
|
right: 35.rpx),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize:
|
||||||
|
MainAxisSize.max,
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'体重(kg)',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
'Readex Pro',
|
'Readex Pro',
|
||||||
@@ -482,9 +563,9 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
|||||||
controller.model.peopleList[
|
controller.model.peopleList[
|
||||||
index]
|
index]
|
||||||
[
|
[
|
||||||
'height'] !=
|
'weight'] !=
|
||||||
null
|
null
|
||||||
? "${controller.model.peopleList[index]['height']} cm"
|
? "${controller.model.peopleList[index]['weight']} kg"
|
||||||
: '',
|
: '',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
@@ -509,158 +590,50 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
getLine(),
|
),
|
||||||
Obx(
|
|
||||||
() => Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 90.rpx,
|
|
||||||
margin: EdgeInsets.only(
|
|
||||||
left: 40.rpx,
|
|
||||||
right: 35.rpx),
|
|
||||||
decoration: BoxDecoration(),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
FocusScope.of(context)
|
|
||||||
.requestFocus(
|
|
||||||
FocusNode());
|
|
||||||
Future.delayed(
|
|
||||||
const Duration(
|
|
||||||
milliseconds:
|
|
||||||
250), () {
|
|
||||||
showWeightPickerDialog(
|
|
||||||
context,
|
|
||||||
initialWeight: controller
|
|
||||||
.model
|
|
||||||
.peopleList[
|
|
||||||
index]
|
|
||||||
['weight'] ??
|
|
||||||
"",
|
|
||||||
onConfirm: (int
|
|
||||||
selectedWeight) {
|
|
||||||
controller.model.peopleList[
|
|
||||||
index]
|
|
||||||
['weight'] =
|
|
||||||
selectedWeight
|
|
||||||
.toString(); // ✅ 转成字符串
|
|
||||||
controller
|
|
||||||
.updateAll();
|
|
||||||
print(
|
|
||||||
"体重: $selectedWeight kg");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.max,
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment
|
|
||||||
.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'体重(kg)',
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily:
|
|
||||||
'Readex Pro',
|
|
||||||
color: Color(
|
|
||||||
0xFF9EA4B7),
|
|
||||||
fontSize: 30.rpx,
|
|
||||||
letterSpacing: 0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
controller.model.peopleList[
|
|
||||||
index]
|
|
||||||
[
|
|
||||||
'weight'] !=
|
|
||||||
null
|
|
||||||
? "${controller.model.peopleList[index]['weight']} kg"
|
|
||||||
: '',
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily:
|
|
||||||
'Readex Pro',
|
|
||||||
color: Colors
|
|
||||||
.white,
|
|
||||||
fontSize:
|
|
||||||
30.rpx,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 16.rpx),
|
|
||||||
Container(
|
|
||||||
height: 30.rpx,
|
|
||||||
width: 30.rpx,
|
|
||||||
child:
|
|
||||||
SvgPicture
|
|
||||||
.asset(
|
|
||||||
'assets/img/icon/expand_more.svg',
|
|
||||||
color: Colors
|
|
||||||
.white,
|
|
||||||
))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
),
|
||||||
getLine(),
|
getLine(),
|
||||||
Obx(
|
Obx(() => InkWell(
|
||||||
() => Container(
|
onTap: () {
|
||||||
width: double.infinity,
|
// 延迟执行的代码
|
||||||
height: 90.rpx,
|
FocusScope.of(context)
|
||||||
margin: EdgeInsets.only(
|
.requestFocus(
|
||||||
left: 40.rpx,
|
FocusNode());
|
||||||
right: 35.rpx),
|
Future.delayed(
|
||||||
decoration: BoxDecoration(),
|
const Duration(
|
||||||
child: InkWell(
|
milliseconds: 250),
|
||||||
onTap: () {
|
() {
|
||||||
// 延迟执行的代码
|
showDateSelectionDialog(
|
||||||
FocusScope.of(context)
|
context,
|
||||||
.requestFocus(
|
checkDate: controller
|
||||||
FocusNode());
|
.model
|
||||||
Future.delayed(
|
.peopleList[index]
|
||||||
const Duration(
|
['birthday']
|
||||||
milliseconds:
|
is DateTime
|
||||||
250), () {
|
? controller.model
|
||||||
showDateSelectionDialog(
|
.peopleList[index]
|
||||||
context,
|
['birthday']
|
||||||
checkDate: controller
|
: DateTime.tryParse(
|
||||||
.model
|
controller.model.peopleList[index]['birthday'] ??
|
||||||
.peopleList[index]['birthday']
|
'') ??
|
||||||
is DateTime
|
DateTime.now(),
|
||||||
? controller
|
checkChange: (DateTime d) {
|
||||||
.model
|
controller.model
|
||||||
.peopleList[index]
|
.peopleList[
|
||||||
['birthday']
|
index]
|
||||||
: DateTime.tryParse(
|
['birthday'] = d;
|
||||||
controller.model.peopleList[index]['birthday'] ??
|
controller.updateAll();
|
||||||
'') ??
|
|
||||||
DateTime.now(),
|
|
||||||
checkChange:
|
|
||||||
(DateTime d) {
|
|
||||||
controller.model
|
|
||||||
.peopleList[
|
|
||||||
index]
|
|
||||||
['birthday'] = d;
|
|
||||||
controller
|
|
||||||
.updateAll();
|
|
||||||
print("$d");
|
|
||||||
// final String dateStr =
|
|
||||||
// "${d.year}-${d.month.toString().padLeft(2, '0')}";
|
|
||||||
|
|
||||||
// controller.model.peopleList[
|
|
||||||
// index]
|
|
||||||
// ['birthday'] =
|
|
||||||
// dateStr;
|
|
||||||
// controller
|
|
||||||
// .updateAll();
|
|
||||||
// print(dateStr);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 90.rpx,
|
||||||
|
margin: EdgeInsets.only(
|
||||||
|
left: 40.rpx,
|
||||||
|
right: 35.rpx),
|
||||||
|
decoration: BoxDecoration(),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize:
|
mainAxisSize:
|
||||||
MainAxisSize.max,
|
MainAxisSize.max,
|
||||||
@@ -732,8 +705,8 @@ class PeopleInfoPage extends GetView<PeopleInfoController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
),
|
)),
|
||||||
getLine(),
|
getLine(),
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
|||||||
Reference in New Issue
Block a user