Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 85dd5c71
authored
2026-01-27 17:50:40 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bugfix
1 parent
d02385fb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
33 deletions
lib/ui/pages/setting/account_page.dart
lib/ui/pages/setting/account_page.dart
View file @
85dd5c7
...
...
@@ -151,39 +151,7 @@ class AccountPage extends StatelessWidget {
}
final
accountCubit
=
context
.
read
<
AccountCubit
>();
showDialog
<
bool
>(
context:
context
,
builder:
(
BuildContext
ctx
)
{
return
AlertDialog
(
title:
Text
(
'确认注销'
),
content:
Text
(
'您确定要注销当前用户吗?'
),
actions:
[
TextButton
(
onPressed:
()
{
Navigator
.
of
(
ctx
).
pop
(
false
);
},
child:
Text
(
'取消'
),
),
TextButton
(
onPressed:
()
{
Navigator
.
of
(
ctx
).
pop
(
true
);
},
child:
Text
(
'确认'
),
),
],
);
},
).
then
((
value
)
{
if
(
value
==
true
)
{
Fluttertoast
.
showToast
(
msg:
'已申请注销,等待流程处理'
,
backgroundColor:
Colors
.
green
,
toastLength:
Toast
.
LENGTH_LONG
,
gravity:
ToastGravity
.
BOTTOM
,
);
accountCubit
.
unbind
();
}
});
_showLogoffDialog
(
context
,
accountCubit
);
},
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
Color
(
0xFFE74C3C
),
...
...
@@ -274,4 +242,37 @@ class AccountPage extends StatelessWidget {
),
);
}
void
_showLogoffDialog
(
BuildContext
context
,
AccountCubit
accountCubit
)
{
showDialog
<
bool
>(
context:
context
,
builder:
(
BuildContext
ctx
)
{
return
AlertDialog
(
title:
Text
(
'确认注销'
),
content:
Text
(
'您确定要注销当前用户吗?'
),
actions:
[
TextButton
(
onPressed:
()
{
Navigator
.
of
(
ctx
).
pop
(
false
);
},
child:
Text
(
'取消'
),
),
TextButton
(
onPressed:
()
{
Navigator
.
of
(
ctx
).
pop
(
true
);
Fluttertoast
.
showToast
(
msg:
'已申请注销,等待流程处理'
,
backgroundColor:
Colors
.
green
,
toastLength:
Toast
.
LENGTH_LONG
,
gravity:
ToastGravity
.
BOTTOM
,
);
accountCubit
.
unbind
();
},
child:
Text
(
'确认'
),
),
],
);
},
);
}
}
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment