|
|
|
@ -61,6 +61,7 @@ class _UserInfoPage extends State<UserInfoPage> {
|
|
|
|
|
String mobile = ""; |
|
|
|
|
String locale = "zh"; |
|
|
|
|
UserInfo user; |
|
|
|
|
int selectSexIndex = 0; |
|
|
|
|
|
|
|
|
|
refresh() async { |
|
|
|
|
setState(() {}); |
|
|
|
@ -155,11 +156,13 @@ class _UserInfoPage extends State<UserInfoPage> {
|
|
|
|
|
height: 1, |
|
|
|
|
color: Color(0xFFF2F2F2), |
|
|
|
|
), |
|
|
|
|
avatarItem( |
|
|
|
|
5, |
|
|
|
|
(age == null || age == "") |
|
|
|
|
? S.of(context).wanshanshengrixinxi_nl |
|
|
|
|
: S.of(context).sui(age)), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
showSexSelect(selectSexIndex); |
|
|
|
|
}, |
|
|
|
|
child: avatarItem( |
|
|
|
|
5, (modifyInfo["sex"] != null && modifyInfo["sex"] != "") ? modifyInfo["sex"]:"还未选择性别"), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
@ -192,9 +195,10 @@ class _UserInfoPage extends State<UserInfoPage> {
|
|
|
|
|
"个性签名", |
|
|
|
|
S.current.wodeshengri, |
|
|
|
|
S.current.shoujihao, |
|
|
|
|
S.current.wodenianling, |
|
|
|
|
"性别", |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
///生日时期选择 |
|
|
|
|
showDateSelector() async { |
|
|
|
|
DateTime dateTime = await showModalBottomSheet( |
|
|
|
|
backgroundColor: Colors.transparent, |
|
|
|
@ -211,6 +215,142 @@ class _UserInfoPage extends State<UserInfoPage> {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///性别选择 |
|
|
|
|
showSexSelect(index) { |
|
|
|
|
showModalBottomSheet( |
|
|
|
|
context: context, |
|
|
|
|
builder: (context) { |
|
|
|
|
return StatefulBuilder(builder: ( |
|
|
|
|
context, |
|
|
|
|
state, |
|
|
|
|
) { |
|
|
|
|
return Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 170.h, |
|
|
|
|
padding: EdgeInsets.only(top: 12.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topRight: Radius.circular(6), |
|
|
|
|
topLeft: Radius.circular(6), |
|
|
|
|
)), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 14.w), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child:GestureDetector( |
|
|
|
|
behavior:HitTestBehavior.opaque, |
|
|
|
|
onTap: (){ |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).quxiao, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: MyFontWeight.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior:HitTestBehavior.opaque, |
|
|
|
|
onTap: (){ |
|
|
|
|
state((){ |
|
|
|
|
modifyInfo["sex"] = (selectSexIndex == 0)?"男":"女"; |
|
|
|
|
modifyInfos(); |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
});}, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).queding, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF32A060), |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: MyFontWeight.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only(top: 12.h, bottom: 13.h), |
|
|
|
|
height: 1.h, |
|
|
|
|
color: Color(0xFFF2F2F2)), |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior:HitTestBehavior.opaque, |
|
|
|
|
onTap: () { |
|
|
|
|
state((){ |
|
|
|
|
selectSexIndex = 0; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
padding: |
|
|
|
|
EdgeInsets.only(top:12.h, bottom:12.h, left: 12.w), |
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 14.w), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
borderRadius:BorderRadius.circular(6), |
|
|
|
|
border: Border.all( |
|
|
|
|
color: selectSexIndex == 0 ? Color(0xFF32A060):Color(0xFFF7F7F7), |
|
|
|
|
width: selectSexIndex == 0 ? 1 :0, |
|
|
|
|
), |
|
|
|
|
color: selectSexIndex == 0 ? Color(0xFFF0FAF4) :Color(0xFFF7F7F7), |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
"男", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: selectSexIndex == 0? Color(0xFF32A060):Color(0xFF4D4D4D), |
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 13.h, |
|
|
|
|
), |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior:HitTestBehavior.opaque, |
|
|
|
|
onTap: () { |
|
|
|
|
state((){ |
|
|
|
|
selectSexIndex = 1; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
padding: |
|
|
|
|
EdgeInsets.only(top: 12.h, bottom: 12.h, left: 12.w), |
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 14.w), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
borderRadius:BorderRadius.circular(6), |
|
|
|
|
border: Border.all( |
|
|
|
|
color: selectSexIndex == 1 ? Color(0xFF32A060):Color(0xFFF7F7F7), |
|
|
|
|
width: selectSexIndex == 1 ? 1 :0, |
|
|
|
|
), |
|
|
|
|
color: selectSexIndex == 1 ? Color(0xFFF0FAF4) :Color(0xFFF7F7F7), |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
"女", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: selectSexIndex == 1 ?Color(0xFF32A060):Color(0xFF4D4D4D), |
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///显示图片选择方式 |
|
|
|
|
showImagePicker() { |
|
|
|
|
showCupertinoModalPopup( |
|
|
|
|