|
|
|
@ -6,6 +6,7 @@ import 'package:dating_touchme_app/pages/mine/tag_setting_page.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
import 'package:tdesign_flutter/tdesign_flutter.dart'; |
|
|
|
|
|
|
|
class EditInfoPage extends StatefulWidget { |
|
|
|
const EditInfoPage({super.key}); |
|
|
|
@ -105,7 +106,11 @@ class _EditInfoPageState extends State<EditInfoPage> { |
|
|
|
SizedBox( |
|
|
|
child: ClipRRect( |
|
|
|
borderRadius: BorderRadius.all(Radius.circular(85.w)), |
|
|
|
child: Image.asset( |
|
|
|
child: (controller.userData.value?.profilePhoto?.isNotEmpty ?? false) ? Image.network( |
|
|
|
"${controller.userData.value?.profilePhoto ?? ""}", |
|
|
|
width: 85.w, |
|
|
|
height: 85.w, |
|
|
|
) : Image.asset( |
|
|
|
Assets.imagesUserAvatar, |
|
|
|
width: 85.w, |
|
|
|
height: 85.w, |
|
|
|
@ -116,7 +121,7 @@ class _EditInfoPageState extends State<EditInfoPage> { |
|
|
|
right: 8.w, |
|
|
|
bottom: 1.w, |
|
|
|
child: Image.asset( |
|
|
|
Assets.imagesUserAvatar, |
|
|
|
Assets.imagesEditAvatar, |
|
|
|
width: 17.w, |
|
|
|
height: 17.w, |
|
|
|
), |
|
|
|
@ -205,7 +210,13 @@ class _EditInfoPageState extends State<EditInfoPage> { |
|
|
|
], |
|
|
|
), |
|
|
|
SizedBox(height: 2.w,), |
|
|
|
SetItem(label: "昵称",), |
|
|
|
SetItem(label: "昵称", child: Text( |
|
|
|
controller.userData.value?.nickName ?? "", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 13.w, |
|
|
|
fontWeight: FontWeight.w500 |
|
|
|
), |
|
|
|
),), |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(bottom: 3.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
@ -235,7 +246,7 @@ class _EditInfoPageState extends State<EditInfoPage> { |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
"${controller.userData.value?.genderValue ?? ""}", |
|
|
|
"${controller.userData.value?.genderCode == 0 ? "男" : "女"}", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 13.w, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
@ -244,7 +255,8 @@ class _EditInfoPageState extends State<EditInfoPage> { |
|
|
|
), |
|
|
|
SizedBox(width: 15.w,), |
|
|
|
Image.asset( |
|
|
|
Assets.imagesMale, |
|
|
|
controller.userData.value?.genderCode == 0 ? |
|
|
|
Assets.imagesMale : Assets.imagesFemale, |
|
|
|
width: 13.w, |
|
|
|
height: 13.w, |
|
|
|
color: const Color.fromRGBO(218, 218, 218, 1) |
|
|
|
@ -302,16 +314,153 @@ class _EditInfoPageState extends State<EditInfoPage> { |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
SetItem(label: "身高",), |
|
|
|
SetItem(label: "所在地", showRequired: false,), |
|
|
|
SetItem(label: "家乡",), |
|
|
|
SetItem(label: "学历",), |
|
|
|
SetItem(label: "学校",), |
|
|
|
SetItem(label: "职业",), |
|
|
|
SetItem(label: "身高", child: Expanded( |
|
|
|
child: TextField( |
|
|
|
controller: controller.heightController, |
|
|
|
keyboardType: TextInputType.number, |
|
|
|
textAlign: TextAlign.end, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: ScreenUtil().setWidth(13), |
|
|
|
height: 1 |
|
|
|
), |
|
|
|
decoration: InputDecoration( |
|
|
|
contentPadding: EdgeInsets.symmetric( |
|
|
|
vertical: 0, |
|
|
|
horizontal: 0.w |
|
|
|
), |
|
|
|
hintText: "请输入身高", |
|
|
|
|
|
|
|
hintStyle: TextStyle( |
|
|
|
color: const Color.fromRGBO(191, 191, 191, 1) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
border: const OutlineInputBorder( |
|
|
|
borderSide: BorderSide.none, // 这将移除边框 // 可选:设置圆角 |
|
|
|
), |
|
|
|
// 如果你希望聚焦时和未聚焦时都没有边框,也可以设置 focusedBorder 和 enabledBorder |
|
|
|
focusedBorder: const OutlineInputBorder( |
|
|
|
borderSide: BorderSide.none, |
|
|
|
borderRadius: BorderRadius.all(Radius.circular(8.0)), |
|
|
|
), |
|
|
|
enabledBorder: const OutlineInputBorder( |
|
|
|
borderSide: BorderSide.none, |
|
|
|
borderRadius: BorderRadius.all(Radius.circular(8.0)), |
|
|
|
), |
|
|
|
), |
|
|
|
onChanged: (value){ |
|
|
|
controller.height = value; |
|
|
|
setState(() { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
), |
|
|
|
),), |
|
|
|
SetItem(label: "所在地", child: SizedBox(),), |
|
|
|
SetItem(label: "家乡", child: SizedBox(),), |
|
|
|
SetItem(label: "学历", child: InkWell( |
|
|
|
onTap: () { |
|
|
|
TDPicker.showMultiPicker(context, title: '', |
|
|
|
onConfirm: (selected) { |
|
|
|
print(selected); |
|
|
|
print(controller.educationList[selected[0]]); |
|
|
|
setState(() { |
|
|
|
|
|
|
|
}); |
|
|
|
Navigator.of(context).pop(); |
|
|
|
}, data: [controller.educationList.map((e) => e.desc ?? "").toList()]); |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
"请选择", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 13.w, |
|
|
|
color: const Color.fromRGBO(191, 191, 191, 1) |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
SetItem(label: "职业", child: InkWell( |
|
|
|
onTap: () { |
|
|
|
TDPicker.showMultiLinkedPicker(context, title: '', |
|
|
|
onConfirm: (selected) { |
|
|
|
print(selected); |
|
|
|
setState(() { |
|
|
|
|
|
|
|
}); |
|
|
|
Navigator.of(context).pop(); |
|
|
|
}, |
|
|
|
data: controller.occupationShowData, |
|
|
|
columnNum: 2, |
|
|
|
initialData:[]); |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
"请选择", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 13.w, |
|
|
|
color: const Color.fromRGBO(191, 191, 191, 1) |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
// SetItem(label: "公司", showRequired: false,), |
|
|
|
// SetItem(label: "月收入",), |
|
|
|
// SetItem(label: "婚姻状况", showRequired: false,), |
|
|
|
// SetItem(label: "有无房产", showRequired: false,), |
|
|
|
SetItem(label: "月收入", child: InkWell( |
|
|
|
onTap: () { |
|
|
|
TDPicker.showMultiPicker(context, title: '', |
|
|
|
onConfirm: (selected) { |
|
|
|
print(selected); |
|
|
|
print(controller.incomeList[selected[0]]); |
|
|
|
setState(() { |
|
|
|
|
|
|
|
}); |
|
|
|
Navigator.of(context).pop(); |
|
|
|
}, data: [controller.incomeList.map((e) => e.desc ?? "").toList()]); |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
"请选择", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 13.w, |
|
|
|
color: const Color.fromRGBO(191, 191, 191, 1) |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
SetItem(label: "婚姻状况", child: InkWell( |
|
|
|
onTap: () { |
|
|
|
TDPicker.showMultiPicker(context, title: '', |
|
|
|
onConfirm: (selected) { |
|
|
|
print(selected); |
|
|
|
print(controller.maritalList[selected[0]]); |
|
|
|
setState(() { |
|
|
|
|
|
|
|
}); |
|
|
|
Navigator.of(context).pop(); |
|
|
|
}, data: [controller.maritalList.map((e) => e.desc ?? "").toList()]); |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
"请选择", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 13.w, |
|
|
|
color: const Color.fromRGBO(191, 191, 191, 1) |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
SetItem(label: "有无房产", child: InkWell( |
|
|
|
onTap: () { |
|
|
|
TDPicker.showMultiPicker(context, title: '', |
|
|
|
onConfirm: (selected) { |
|
|
|
print(selected); |
|
|
|
print(controller.propertyList[selected[0]]); |
|
|
|
setState(() { |
|
|
|
|
|
|
|
}); |
|
|
|
Navigator.of(context).pop(); |
|
|
|
}, data: [controller.propertyList.map((e) => e.desc ?? "").toList()]); |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
"请选择", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 13.w, |
|
|
|
color: const Color.fromRGBO(191, 191, 191, 1) |
|
|
|
), |
|
|
|
), |
|
|
|
),), |
|
|
|
// SizedBox(height: 8.w,), |
|
|
|
// InkWell( |
|
|
|
// onTap: (){ |
|
|
|
@ -702,7 +851,8 @@ class _EditInfoPageState extends State<EditInfoPage> { |
|
|
|
class SetItem extends StatefulWidget { |
|
|
|
final String label; |
|
|
|
final bool showRequired; |
|
|
|
const SetItem({super.key, required this.label, this.showRequired = true}); |
|
|
|
final Widget child; |
|
|
|
const SetItem({super.key, required this.label, this.showRequired = true, required this.child}); |
|
|
|
|
|
|
|
@override |
|
|
|
State<SetItem> createState() => _SetItemState(); |
|
|
|
@ -746,22 +896,19 @@ class _SetItemState extends State<SetItem> { |
|
|
|
] |
|
|
|
), |
|
|
|
), |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
"未选择", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 13.w, |
|
|
|
color: const Color.fromRGBO(191, 191, 191, 1) |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width: 15.w,), |
|
|
|
Icon( |
|
|
|
Icons.keyboard_arrow_right, |
|
|
|
size: 13.w, |
|
|
|
color: const Color.fromRGBO(191, 191, 191, 1) |
|
|
|
) |
|
|
|
], |
|
|
|
Expanded( |
|
|
|
child: Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.end, |
|
|
|
children: [ |
|
|
|
widget.child, |
|
|
|
SizedBox(width: 15.w,), |
|
|
|
Icon( |
|
|
|
Icons.keyboard_arrow_right, |
|
|
|
size: 13.w, |
|
|
|
color: const Color.fromRGBO(191, 191, 191, 1) |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
|