forked from firka/student-legacy
update in user changer
This commit is contained in:
parent
a0975d635d
commit
a93f1c2422
@ -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];
|
||||||
|
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user