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