Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
1486cb3c
提交
1486cb3c
authored
2月 22, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/test' into test
上级
0a919af7
7a9c606e
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
48 行增加
和
35 行删除
+48
-35
view.dart
lib/pages/user_security/view.dart
+48
-35
没有找到文件。
lib/pages/user_security/view.dart
浏览文件 @
1486cb3c
part of
user_security
;
class
UserSecurityPage
extends
StatefulWidget
{
final
UserInfoModel
model
;
const
UserSecurityPage
({
Key
?
key
,
required
this
.
model
})
:
super
(
key:
key
);
const
UserSecurityPage
({
Key
?
key
,
required
this
.
model
})
:
super
(
key:
key
);
@override
State
<
UserSecurityPage
>
createState
()
=>
_UserSecurityPageState
();
...
...
@@ -23,7 +20,7 @@ class _UserSecurityPageState extends State<UserSecurityPage> {
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
.
w
,
horizontal:
10
.
w
),
margin:
EdgeInsets
.
symmetric
(
vertical:
10
.
w
,
horizontal:
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
...
...
@@ -39,22 +36,25 @@ class _UserSecurityPageState extends State<UserSecurityPage> {
child:
Column
(
children:
[
GestureDetector
(
onTap:
()
{
onTap:
()
{
context
.
pushNamed
(
Routes
.
changePhone
);
},
child:
_buildItem
(
title:
'修改手机号码'
,
value:
widget
.
model
.
phone
??
''
)
),
child:
_buildItem
(
title:
'修改手机号码'
,
value:
widget
.
model
.
phone
??
''
)
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
height:
0.5
.
w
,
color:
Colours
.
cF0
,
color:
Colours
.
cF0
,
),
GestureDetector
(
onTap:
()
{
context
.
pushNamed
(
Routes
.
changePwd
,
extra:
widget
.
model
);
onTap:
()
{
context
.
pushNamed
(
Routes
.
changePwd
,
extra:
widget
.
model
);
},
child:
_buildItem
(
title:
'修改密码'
,
value:
widget
.
model
.
password
.
toString
().
isEmpty
?
'未设置'
:
''
)
),
child:
_buildItem
(
title:
'修改密码'
,
value:
widget
.
model
.
password
.
toString
().
isEmpty
?
'未设置'
:
''
)),
],
),
),
...
...
@@ -84,10 +84,14 @@ class _UserSecurityPageState extends State<UserSecurityPage> {
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
),
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
child:
Center
(
child:
Text
(
'确定注销账号吗'
,
...
...
@@ -104,15 +108,20 @@ class _UserSecurityPageState extends State<UserSecurityPage> {
width:
double
.
infinity
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
],),
],
),
// 去除操作按钮区域的内边距
actionsPadding:
EdgeInsets
.
zero
,
actions:
<
Widget
>[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
// 或者使用MainAxisAlignment.spaceEvenly
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
GestureDetector
(
onTap:
()
=>
Navigator
.
of
(
context
).
pop
(),
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消'
,
style:
TextStyle
(
...
...
@@ -122,6 +131,7 @@ class _UserSecurityPageState extends State<UserSecurityPage> {
),
),
),
),
Container
(
height:
39.5
.
w
,
// 设置分割线的高度
width:
1
,
// 设置分割线的宽度
...
...
@@ -130,15 +140,19 @@ class _UserSecurityPageState extends State<UserSecurityPage> {
GestureDetector
(
onTap:
()
async
{
final
result
=
await
AccountAPI
.
delete
();
if
(
result
){
if
(
result
)
{
CustomToast
.
loading
();
await
UserStore
.
to
.
logout
();
CustomToast
.
dismiss
();
if
(
context
.
mounted
)
{
if
(
context
.
mounted
)
{
context
.
goNamed
(
Routes
.
splash
);
}
}
},
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'确定'
,
style:
TextStyle
(
...
...
@@ -148,18 +162,13 @@ class _UserSecurityPageState extends State<UserSecurityPage> {
),
),
),
),
],
),
],
);
},
);
},
),
],
...
...
@@ -170,27 +179,31 @@ class _UserSecurityPageState extends State<UserSecurityPage> {
);
}
Widget
_buildItem
({
required
String
title
,
required
String
value
})
{
Widget
_buildItem
({
required
String
title
,
required
String
value
})
{
return
Container
(
margin:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
),
margin:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
),
color:
Colors
.
white
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
GestureDetector
(
onTap:
()
async
{
},
onTap:
()
async
{},
child:
Container
(
color:
Colors
.
white
,
height:
45
.
w
,
height:
45
.
w
,
alignment:
Alignment
.
centerLeft
,
child:
Text
(
title
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c3
)),
child:
Text
(
title
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c3
)),
),
),
Row
(
children:
[
Text
(
value
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c9
),),
Text
(
value
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c9
),
),
Gaps
.
hGaps10
,
Image
.
asset
(
'assets/images/right_arrow.png'
)
],
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论