mod: account (#989)

This commit is contained in:
My-Responsitories
2025-08-11 11:01:00 +08:00
committed by GitHub
parent dc61d9007f
commit e7f27e4913
2 changed files with 11 additions and 4 deletions

View File

@@ -698,9 +698,10 @@ class LoginPageController extends GetxController
}
}
static Future<void> switchAccountDialog(BuildContext context) {
static Future<void>? switchAccountDialog(BuildContext context) {
if (Accounts.account.isEmpty) {
return SmartDialog.showToast('请先登录');
SmartDialog.showToast('请先登录');
return Get.toNamed('/loginPage');
}
final selectAccount = Map.of(Accounts.accountMode);
final options = {

View File

@@ -40,7 +40,7 @@ class SettingPage extends StatefulWidget {
class _SettingPageState extends State<SettingPage> {
late SettingType _type = SettingType.privacySetting;
final RxBool _noAccount = Accounts.accountMode.isEmpty.obs;
final RxBool _noAccount = Accounts.account.isEmpty.obs;
late bool _isPortrait;
final List<_SettingsModel> _items = const [
@@ -147,6 +147,12 @@ class _SettingPageState extends State<SettingPage> {
);
}
@override
void dispose() {
_noAccount.close();
super.dispose();
}
void _toPage(SettingType type) {
if (_isPortrait) {
Get.toNamed('/${type.name}');
@@ -189,7 +195,7 @@ class _SettingPageState extends State<SettingPage> {
ListTile(
onTap: () => LoginPageController.switchAccountDialog(context),
leading: const Icon(Icons.switch_account_outlined),
title: const Text('设置账号模式'),
title: Text('设置账号模式', style: titleStyle),
),
Obx(
() => _noAccount.value