fix:对齐金值,主要注销,一键登录等方面修改
This commit is contained in:
1 parent
e29ed0a2c8
commit
6997a65c96
37 files changed
+3442
-514
No files matched your search
@@ -19,6 +19,8 @@ class ProfilePage extends ConsumerWidget {
|
||||
final auth = ref.watch(authProvider);
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
final loggedIn = auth.valueOrNull is LoggedInAuthState;
|
||||
final authLoading = auth.isLoading;
|
||||
final authFailed = auth.hasError;
|
||||
final currentUser = auth.valueOrNull is LoggedInAuthState
|
||||
? (auth.valueOrNull as LoggedInAuthState).user
|
||||
: null;
|
||||
@@ -100,8 +102,22 @@ class ProfilePage extends ConsumerWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
FilledButton.tonal(
|
||||
onPressed: () => LoginLauncher.start(context, ref),
|
||||
child: Text(loggedIn ? '切换账号' : '去登录'),
|
||||
onPressed: authLoading
|
||||
? null
|
||||
: authFailed
|
||||
? () => ref
|
||||
.read(authProvider.notifier)
|
||||
.retryBootstrap()
|
||||
: () => LoginLauncher.start(context, ref),
|
||||
child: Text(
|
||||
authLoading
|
||||
? '正在恢复账号…'
|
||||
: authFailed
|
||||
? '账号恢复失败,点击重试'
|
||||
: loggedIn
|
||||
? '切换账号'
|
||||
: '去登录',
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
OutlinedButton(
|
||||
|
||||
Reference in new issue
Block a user