Skip to content

Commit

Permalink
Add account switch in global fab
Browse files Browse the repository at this point in the history
  • Loading branch information
narumi147 committed Aug 25, 2024
1 parent e97cf54 commit 41ca9ca
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lib/app/modules/root/global_fab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,34 @@ class __DebugMenuDialogState extends State<_DebugMenuDialog> {
},
),
),
ListTile(
leading: const Icon(Icons.account_circle),
title: Text(S.current.account_title),
trailing: DropdownButton<int>(
underline: const Divider(thickness: 0, color: Colors.transparent),
value: db.userData.curUserKey,
items: [
for (final (index, user) in db.userData.users.indexed)
DropdownMenuItem(
value: index,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 180),
child: Text(user.name, maxLines: 1),
),
),
],
onChanged: (index) {
if (index != null) {
db.userData.curUserKey = index;
EasyDebounce.debounce('itemCenter.init', const Duration(seconds: 1), () {
db.itemCenter.init();
});
db.notifyUserdata();
}
setState(() {});
},
),
),
ListTile(
leading: const Icon(Icons.color_lens_outlined),
title: const Text('Palette'),
Expand Down

0 comments on commit 41ca9ca

Please sign in to comment.