Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
33ce5c6e
提交
33ce5c6e
authored
1月 20, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修正
上级
d383199f
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
12 行增加
和
16 行删除
+12
-16
view.dart
lib/pages/user_info/view.dart
+2
-9
controller.dart
lib/pages/user_nick/controller.dart
+1
-1
view.dart
lib/pages/user_nick/view.dart
+9
-6
没有找到文件。
lib/pages/user_info/view.dart
浏览文件 @
33ce5c6e
...
@@ -12,12 +12,7 @@ class UserInfoPage extends StatefulWidget {
...
@@ -12,12 +12,7 @@ class UserInfoPage extends StatefulWidget {
class
_UserInfoPageState
extends
State
<
UserInfoPage
>
{
class
_UserInfoPageState
extends
State
<
UserInfoPage
>
{
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
return
GetBuilder
<
UserInfoController
>(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserInfoController
>(
init:
UserInfoController
(
widget
.
userInfo
),
init:
UserInfoController
(
widget
.
userInfo
),
builder:
(
controller
)
=>
builder:
(
controller
)
=>
Scaffold
(
Scaffold
(
...
@@ -131,9 +126,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
...
@@ -131,9 +126,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
],
],
),
),
),
),
)),)
)),);
,
);
}
}
getGender
(
num
?
sex
)
{
getGender
(
num
?
sex
)
{
...
...
lib/pages/user_nick/controller.dart
浏览文件 @
33ce5c6e
...
@@ -6,7 +6,7 @@ class UserNickController extends GetxController {
...
@@ -6,7 +6,7 @@ class UserNickController extends GetxController {
UserNickController
(
this
.
userInfo
);
UserNickController
(
this
.
userInfo
);
/// 修改用用户信息
/// 修改用用户信息
void
_
changeInfo
(
String
nick
)
async
{
void
changeInfo
(
String
nick
)
async
{
final
result
=
await
MineAPI
.
changeInfo
(
name:
nick
);
final
result
=
await
MineAPI
.
changeInfo
(
name:
nick
);
if
(
result
)
{
if
(
result
)
{
Toast
.
show
(
'修改成功'
);
Toast
.
show
(
'修改成功'
);
...
...
lib/pages/user_nick/view.dart
浏览文件 @
33ce5c6e
...
@@ -10,7 +10,8 @@ class UserNickPage extends StatefulWidget {
...
@@ -10,7 +10,8 @@ class UserNickPage extends StatefulWidget {
}
}
class
_UserNickPageState
extends
State
<
UserNickPage
>
{
class
_UserNickPageState
extends
State
<
UserNickPage
>
{
TextEditingController
_textFieldController
=
TextEditingController
();
final
TextEditingController
_textFieldController
=
TextEditingController
();
final
FocusNode
_focusNode
=
FocusNode
();
@override
@override
void
initState
()
{
void
initState
()
{
...
@@ -32,24 +33,25 @@ class _UserNickPageState extends State<UserNickPage> {
...
@@ -32,24 +33,25 @@ class _UserNickPageState extends State<UserNickPage> {
width:
40
,
width:
40
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10
),
borderRadius:
BorderRadius
.
circular
(
10
),
border:
Border
.
all
(
color:
AppTheme
.
primary
,
width:
1
)),
border:
Border
.
all
(
color:
Colours
.
c3
,
width:
0.5
)),
child:
Center
(
child:
Center
(
child:
GestureDetector
(
child:
GestureDetector
(
onTap:
()
{
onTap:
()
{
// print("保存昵称");
// print("保存昵称");
controller
.
_changeInfo
(
_textFieldController
.
text
);
controller
.
changeInfo
(
_textFieldController
.
text
);
_focusNode
.
unfocus
();
},
},
child:
const
Text
(
child:
const
Text
(
'保存'
,
'保存'
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
12
,
color:
AppTheme
.
primary
),
fontSize:
12
,
color:
Colours
.
c3
),
)),
)),
),
),
)
)
],
],
),
),
body:
Container
(
body:
Container
(
margin:
const
EdgeInsets
.
symmetric
(
horizontal
:
AppTheme
.
margin
),
margin:
const
EdgeInsets
.
only
(
left:
AppTheme
.
margin
,
right:
AppTheme
.
margin
,
top
:
AppTheme
.
margin
),
height:
42
,
height:
42
,
decoration:
BoxDecoration
(
boxShadow:
[
decoration:
BoxDecoration
(
boxShadow:
[
BoxShadow
(
BoxShadow
(
...
@@ -86,6 +88,7 @@ class _UserNickPageState extends State<UserNickPage> {
...
@@ -86,6 +88,7 @@ class _UserNickPageState extends State<UserNickPage> {
focusedBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
suffixIconConstraints:
BoxConstraints
.
tightFor
(
suffixIconConstraints:
BoxConstraints
.
tightFor
(
height:
15
,
width:
15
)),
height:
15
,
width:
15
)),
focusNode:
_focusNode
,
),
),
),
),
GestureDetector
(
GestureDetector
(
...
@@ -95,7 +98,7 @@ class _UserNickPageState extends State<UserNickPage> {
...
@@ -95,7 +98,7 @@ class _UserNickPageState extends State<UserNickPage> {
print
(
'Image Clicked!'
);
print
(
'Image Clicked!'
);
},
},
child:
Image
(
child:
Image
(
image:
AssetImage
(
'assets/images/del.png'
),
image:
const
AssetImage
(
'assets/images/del.png'
),
height:
15
.
w
,
height:
15
.
w
,
width:
15
.
w
,
width:
15
.
w
,
),
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论