diff --git a/lib/ui/settings/nick_name_change_page.dart b/lib/ui/settings/nick_name_change_page.dart index 7f1e2ff..f2c95df 100644 --- a/lib/ui/settings/nick_name_change_page.dart +++ b/lib/ui/settings/nick_name_change_page.dart @@ -49,7 +49,7 @@ class _NickNameChangePageState extends State { controller: _textEditingController, decoration: InputDecoration( contentPadding: EdgeInsets.zero, - hintText: '${userProvider.userInfoModel.nickName}', + hintText: '${userProvider.infoModel.nickName}', hintStyle: TextStyle(color: Color(0xFF999999), fontSize: 34.sp), border: UnderlineInputBorder( @@ -62,7 +62,7 @@ class _NickNameChangePageState extends State { 150.w.heightBox, MaterialButton( onPressed: () async { - BaseModel baseModel = await NetUtil().get( + BaseModel baseModel = await NetUtil().post( API.user.updateNickName, params: {'nickName': _textEditingController.text}); diff --git a/lib/ui/settings/user_info_page.dart b/lib/ui/settings/user_info_page.dart index d928bd2..94bce98 100644 --- a/lib/ui/settings/user_info_page.dart +++ b/lib/ui/settings/user_info_page.dart @@ -1,5 +1,6 @@ // Flutter imports: import 'package:aku_community_manager/tools/aku_divider.dart'; +import 'package:aku_community_manager/ui/settings/nick_name_change_page.dart'; import 'package:flutter/material.dart'; // Package imports: @@ -14,6 +15,7 @@ import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_tile.dart'; import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart'; import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart'; +import 'package:aku_community_manager/tools/extensions/router_extension_tool.dart'; class UserInfoPage extends StatefulWidget { UserInfoPage({Key key}) : super(key: key); @@ -42,7 +44,10 @@ class _UserInfoPageState extends State { suffix: AkuAvatar(), ), AkuTile( - onTap: () {}, + onTap: () async { + await NickNameChangePage().to(); + setState(() {}); + }, title: Text('昵称'), suffix: Text(userProvider.infoModel.nickName), ),