|
|
@ -44,13 +44,13 @@ class _UserInfoPage extends State<UserInfoPage> { |
|
|
|
SharedPreferences.getInstance().then((value) => { |
|
|
|
SharedPreferences.getInstance().then((value) => { |
|
|
|
print(value.getString('user')), |
|
|
|
print(value.getString('user')), |
|
|
|
user = UserInfo.fromJson(jsonDecode(value.getString('user'))), |
|
|
|
user = UserInfo.fromJson(jsonDecode(value.getString('user'))), |
|
|
|
mobile = user.phone, |
|
|
|
mobile = user?.phone ?? "", |
|
|
|
modifyInfo["nickname"] = user.nickname, |
|
|
|
modifyInfo["nickname"] = user?.nickname ??"", |
|
|
|
modifyInfo["signature"] = user.signature, |
|
|
|
modifyInfo["signature"] = user?.signature ?? "", |
|
|
|
modifyInfo["birth"] = user.birth, |
|
|
|
modifyInfo["birth"] = user?.birth ?? "", |
|
|
|
modifyInfo["headimg"] = user.headimg, |
|
|
|
modifyInfo["headimg"] = user?.headimg ?? "", |
|
|
|
modifyInfo["sex"] = user.sex, |
|
|
|
modifyInfo["sex"] = user?.sex ?? "", |
|
|
|
age = AppUtils.getAgeByString(user.birth), |
|
|
|
age = AppUtils.getAgeByString(user ?.birth ?? ""), |
|
|
|
refresh(), |
|
|
|
refresh(), |
|
|
|
apiService = ApiService(Dio(), |
|
|
|
apiService = ApiService(Dio(), |
|
|
|
context: context, token: value.getString('token')), |
|
|
|
context: context, token: value.getString('token')), |
|
|
@ -478,6 +478,8 @@ class _UserInfoPage extends State<UserInfoPage> { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center); |
|
|
|
SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
SmartDialog.showToast("用户信息修改失败 " + info.msg, alignment: Alignment.center); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|