@@ -44,7 +44,7 @@ class _ManageUserDialog extends StatelessWidget with LoggerMixin {
4444 @override
4545 Widget build (BuildContext context) {
4646 final tr = context.t.manageAccountPage.switchAccount.dialog;
47- return CustomAlertDialog (
47+ return CustomAlertDialog . sync (
4848 clipBehavior: Clip .hardEdge,
4949 title: Row (
5050 children: [
@@ -53,54 +53,52 @@ class _ManageUserDialog extends StatelessWidget with LoggerMixin {
5353 Expanded (child: SingleLineText (userInfo.username! , style: Theme .of (context).textTheme.titleLarge)),
5454 ],
5555 ),
56- content: SingleChildScrollView (
57- child: Column (
58- children: [
59- ListTile (
60- title: Text (tr.switchAccount),
61- onTap: () async {
62- var times = 10 ;
63- while (context.read <AutoNotificationCubit >().pause ('switch user' )) {
64- info ('switch user is waiting for auto sync lock... $times ' );
65- times -= 1 ;
66- await Future <void >.delayed (const Duration (milliseconds: 300 ));
67- if (times <= 0 || ! context.mounted) {
68- info ('auto sync lock timeout or canceled, do not switch user' );
69- return ;
70- }
71- }
72- context.read <SwitchUserBloc >().add (SwitchUserStartRequested (userInfo));
73- context.pop ();
74- },
75- ),
76- ListTile (
77- title: Text (tr.clearLoginStatus.title),
78- subtitle: Text (tr.clearLoginStatus.detail),
79- enabled: userInfo.uid != null ,
80- onTap: () async {
81- await getIt.get <StorageProvider >().deleteCookieByUid (userInfo.uid! );
82- if (! context.mounted) {
83- return ;
84- }
85- context.pop ();
86- },
87- ),
88- ListTile (
89- title: Text (tr.loginAgain.title),
90- subtitle: Text (tr.loginAgain.detail),
91- onTap: () async {
92- await context.pushNamed (
93- ScreenPaths .login,
94- queryParameters: {if (userInfo.username != null ) 'username' : '${userInfo .username }' },
95- );
96- if (! context.mounted) {
56+ content: Column (
57+ children: [
58+ ListTile (
59+ title: Text (tr.switchAccount),
60+ onTap: () async {
61+ var times = 10 ;
62+ while (context.read <AutoNotificationCubit >().pause ('switch user' )) {
63+ info ('switch user is waiting for auto sync lock... $times ' );
64+ times -= 1 ;
65+ await Future <void >.delayed (const Duration (milliseconds: 300 ));
66+ if (times <= 0 || ! context.mounted) {
67+ info ('auto sync lock timeout or canceled, do not switch user' );
9768 return ;
9869 }
99- context.pop ();
100- },
101- ),
102- ],
103- ),
70+ }
71+ context.read <SwitchUserBloc >().add (SwitchUserStartRequested (userInfo));
72+ context.pop ();
73+ },
74+ ),
75+ ListTile (
76+ title: Text (tr.clearLoginStatus.title),
77+ subtitle: Text (tr.clearLoginStatus.detail),
78+ enabled: userInfo.uid != null ,
79+ onTap: () async {
80+ await getIt.get <StorageProvider >().deleteCookieByUid (userInfo.uid! );
81+ if (! context.mounted) {
82+ return ;
83+ }
84+ context.pop ();
85+ },
86+ ),
87+ ListTile (
88+ title: Text (tr.loginAgain.title),
89+ subtitle: Text (tr.loginAgain.detail),
90+ onTap: () async {
91+ await context.pushNamed (
92+ ScreenPaths .login,
93+ queryParameters: {if (userInfo.username != null ) 'username' : '${userInfo .username }' },
94+ );
95+ if (! context.mounted) {
96+ return ;
97+ }
98+ context.pop ();
99+ },
100+ ),
101+ ],
104102 ),
105103 );
106104 }
0 commit comments