update in user changer

This commit is contained in:
Kima 2024-02-06 22:02:16 +01:00
parent a0975d635d
commit a93f1c2422
2 changed files with 25 additions and 15 deletions

View File

@ -339,23 +339,26 @@ class SettingsHelper {
} }
// v5 user changer // v5 user changer
static void changeCurrentUser( static void changeCurrentUser(BuildContext context, List<Widget> accountTiles,
BuildContext context, List<Widget> accountTiles, int len) { int len, String addUsrLocTxt) {
showBottomSheetMenu( showBottomSheetMenu(
context, context,
items: List.generate(len, (index) { items: List.generate(len, (index) {
if (index == accountTiles.length) { if (index == accountTiles.length) {
return Center( return const SizedBox(
child: Container( height: 10.0,
margin: const EdgeInsets.only(top: 12.0, bottom: 4.0),
height: 3.0,
width: 75.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.0),
color: AppColors.of(context).text.withOpacity(.25),
),
),
); );
// return Center(
// child: Container(
// margin: const EdgeInsets.only(top: 12.0, bottom: 4.0),
// height: 3.0,
// width: 175.0,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12.0),
// color: AppColors.of(context).text.withOpacity(.25),
// ),
// ),
// );
} else if (index == accountTiles.length + 1) { } else if (index == accountTiles.length + 1) {
return PanelButton( return PanelButton(
onPressed: () { onPressed: () {
@ -370,8 +373,11 @@ class SettingsHelper {
setSystemChrome(context); setSystemChrome(context);
}); });
}, },
title: const Text("add_user"), title: Text(addUsrLocTxt),
leading: const Icon(FeatherIcons.userPlus), leading: const Padding(
padding: EdgeInsets.only(left: 8.22, right: 6.9),
child: Icon(FeatherIcons.userPlus),
),
); );
} else { } else {
return accountTiles[index]; return accountTiles[index];

View File

@ -367,7 +367,11 @@ class SettingsScreenState extends State<SettingsScreen>
// onPressed: () => SoonAlert.show(context: context), // onPressed: () => SoonAlert.show(context: context),
onPressed: () { onPressed: () {
SettingsHelper.changeCurrentUser( SettingsHelper.changeCurrentUser(
context, accountTiles, (accountTiles.length + 2)); context,
accountTiles,
(accountTiles.length + 2),
"add_user".i18n,
);
}, },
title: Text("switch_account".i18n), title: Text("switch_account".i18n),
leading: Icon( leading: Icon(