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
static void changeCurrentUser(
BuildContext context, List<Widget> accountTiles, int len) {
static void changeCurrentUser(BuildContext context, List<Widget> accountTiles,
int len, String addUsrLocTxt) {
showBottomSheetMenu(
context,
items: List.generate(len, (index) {
if (index == accountTiles.length) {
return Center(
child: Container(
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 const SizedBox(
height: 10.0,
);
// 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) {
return PanelButton(
onPressed: () {
@ -370,8 +373,11 @@ class SettingsHelper {
setSystemChrome(context);
});
},
title: const Text("add_user"),
leading: const Icon(FeatherIcons.userPlus),
title: Text(addUsrLocTxt),
leading: const Padding(
padding: EdgeInsets.only(left: 8.22, right: 6.9),
child: Icon(FeatherIcons.userPlus),
),
);
} else {
return accountTiles[index];

View File

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