mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 15:54:35 +01:00
fix: servers batch del
This commit is contained in:
@@ -905,6 +905,10 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
title: Text(l10n.deleteServers),
|
title: Text(l10n.deleteServers),
|
||||||
trailing: const Icon(Icons.delete_forever),
|
trailing: const Icon(Icons.delete_forever),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
context.showRoundDialog<List<String>>(
|
||||||
|
title: Text(l10n.choose),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: StatefulBuilder(builder: (ctx, setState) {
|
||||||
final all = Stores.server.box.keys.map(
|
final all = Stores.server.box.keys.map(
|
||||||
(e) => TextButton(
|
(e) => TextButton(
|
||||||
onPressed: () => context.showRoundDialog(
|
onPressed: () => context.showRoundDialog(
|
||||||
@@ -914,7 +918,11 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
)),
|
)),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Pros.server.delServer(e),
|
onPressed: () {
|
||||||
|
Pros.server.delServer(e);
|
||||||
|
ctx.pop();
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
child: Text(l10n.ok),
|
child: Text(l10n.ok),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -922,13 +930,11 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
child: Text(e),
|
child: Text(e),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
context.showRoundDialog<List<String>>(
|
return Column(
|
||||||
title: Text(l10n.choose),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: all.toList(),
|
children: all.toList(),
|
||||||
),
|
);
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user