* opt: getFileName

* opt: audio-pitch-correction

* opt: spring dialog

* opt: account dialog

* update [skip ci]

---------

Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
My-Responsitories
2026-01-30 10:31:26 +08:00
committed by GitHub
parent 9442b17d63
commit d6e6e52df2
4 changed files with 183 additions and 169 deletions

View File

@@ -740,116 +740,114 @@ class LoginPageController extends GetxController
bool quickSelect = selectAccount.every((e) => e == selectAccount.first);
return showDialog(
context: context,
builder: (context) => Builder(
builder: (context) => AlertDialog(
title: Row(
crossAxisAlignment: .start,
mainAxisAlignment: .spaceBetween,
children: [
Text.rich(
style: const TextStyle(height: 1.5),
TextSpan(
children: [
const TextSpan(text: '账号切换'),
TextSpan(
text: '\nmid 为0时使用匿名',
style: TextStyle(
fontSize: 14,
color: ColorScheme.of(context).outline,
),
builder: (context) => AlertDialog(
title: Row(
crossAxisAlignment: .start,
mainAxisAlignment: .spaceBetween,
children: [
Text.rich(
style: const TextStyle(height: 1.5),
TextSpan(
children: [
const TextSpan(text: '账号切换'),
TextSpan(
text: '\nmid 为0时使用匿名',
style: TextStyle(
fontSize: 14,
color: ColorScheme.of(context).outline,
),
],
),
),
TextButton(
onPressed: () {
quickSelect = !quickSelect;
(context as Element).markNeedsBuild();
},
child: const Text('切换'),
),
],
),
titlePadding: const .only(left: 22, top: 16, right: 22, bottom: 3),
contentPadding: const .symmetric(vertical: 5),
actionsPadding: const .only(left: 16, right: 16, bottom: 10),
content: SingleChildScrollView(
child: AnimatedSize(
curve: Curves.easeIn,
alignment: .topCenter,
duration: const Duration(milliseconds: 200),
child: quickSelect
? Builder(
builder: (context) => RadioGroup<Account>(
groupValue: selectAccount[0],
onChanged: (v) {
for (int i = 0; i < selectAccount.length; i++) {
selectAccount[i] = v!;
}
(context as Element).markNeedsBuild();
},
child: Column(
crossAxisAlignment: .start,
children: options.entries
.map(
(entry) => RadioWidget<Account>(
value: entry.key,
title: entry.value,
mainAxisSize: .max,
padding: const .only(left: 12),
),
)
.toList(),
),
),
)
: Column(
crossAxisAlignment: .start,
children: AccountType.values
.map(
(e) => Builder(
builder: (context) => RadioGroup<Account>(
groupValue: selectAccount[e.index],
onChanged: (v) {
selectAccount[e.index] = v!;
(context as Element).markNeedsBuild();
},
child: WrapRadioOptionsGroup<Account>(
groupTitle: e.title,
options: options,
),
),
),
)
.toList(),
),
),
),
actions: [
TextButton(
onPressed: Get.back,
child: Text(
'取消',
style: TextStyle(color: ColorScheme.of(context).outline),
),
],
),
),
TextButton(
onPressed: () {
Get.back();
for (final type in AccountType.values) {
final index = type.index;
final account = quickSelect
? selectAccount.first
: selectAccount[index];
if (account != Accounts.accountMode[index]) {
Accounts.set(type, account);
}
}
quickSelect = !quickSelect;
(context as Element).markNeedsBuild();
},
child: const Text('确定'),
child: const Text('切换'),
),
],
),
titlePadding: const .only(left: 22, top: 16, right: 22, bottom: 3),
contentPadding: const .symmetric(vertical: 5),
actionsPadding: const .only(left: 16, right: 16, bottom: 10),
content: SingleChildScrollView(
child: AnimatedSize(
curve: Curves.easeIn,
alignment: .topCenter,
duration: const Duration(milliseconds: 200),
child: quickSelect
? Builder(
builder: (context) => RadioGroup<Account>(
groupValue: selectAccount[0],
onChanged: (v) {
selectAccount.fillRange(0, selectAccount.length, v);
(context as Element).markNeedsBuild();
},
child: Column(
crossAxisAlignment: .start,
children: options.entries
.map(
(entry) => RadioWidget<Account>(
value: entry.key,
title: entry.value,
mainAxisSize: .max,
padding: PlatformUtils.isDesktop
? const .only(left: 12)
: const .only(left: 12, top: 2, bottom: 2),
),
)
.toList(),
),
),
)
: Column(
crossAxisAlignment: .start,
children: AccountType.values
.map(
(e) => Builder(
builder: (context) => RadioGroup<Account>(
groupValue: selectAccount[e.index],
onChanged: (v) {
selectAccount[e.index] = v!;
(context as Element).markNeedsBuild();
},
child: WrapRadioOptionsGroup<Account>(
groupTitle: e.title,
options: options,
),
),
),
)
.toList(),
),
),
),
actions: [
TextButton(
onPressed: Get.back,
child: Text(
'取消',
style: TextStyle(color: ColorScheme.of(context).outline),
),
),
TextButton(
onPressed: () {
Get.back();
for (final type in AccountType.values) {
final index = type.index;
final account = quickSelect
? selectAccount.first
: selectAccount[index];
if (account != Accounts.accountMode[index]) {
Accounts.set(type, account);
}
}
},
child: const Text('确定'),
),
],
),
);
}