refactor: Improve UX of user role in UserBottomSheet
This commit is contained in:
parent
3faace9952
commit
b186021f38
1 changed files with 12 additions and 7 deletions
|
|
@ -277,10 +277,8 @@ class UserBottomSheetView extends StatelessWidget {
|
||||||
if (user != null) ...[
|
if (user != null) ...[
|
||||||
Divider(color: theme.dividerColor),
|
Divider(color: theme.dividerColor),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(L10n.of(context).userRole),
|
||||||
'${L10n.of(context).userRole} (${user.powerLevel})',
|
leading: const Icon(Icons.admin_panel_settings_outlined),
|
||||||
),
|
|
||||||
leading: const Icon(Icons.person_outlined),
|
|
||||||
trailing: Material(
|
trailing: Material(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(AppConfig.borderRadius / 2),
|
BorderRadius.circular(AppConfig.borderRadius / 2),
|
||||||
|
|
@ -302,15 +300,22 @@ class UserBottomSheetView extends StatelessWidget {
|
||||||
items: [
|
items: [
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
value: 0,
|
value: 0,
|
||||||
child: Text(L10n.of(context).user),
|
child: Text(L10n.of(context).userLevel(
|
||||||
|
user.powerLevel < 50 ? user.powerLevel : 0)),
|
||||||
),
|
),
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
value: 50,
|
value: 50,
|
||||||
child: Text(L10n.of(context).moderator),
|
child: Text(L10n.of(context).moderatorLevel(
|
||||||
|
user.powerLevel >= 50 && user.powerLevel < 100
|
||||||
|
? user.powerLevel
|
||||||
|
: 50)),
|
||||||
),
|
),
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
value: 100,
|
value: 100,
|
||||||
child: Text(L10n.of(context).admin),
|
child: Text(L10n.of(context).adminLevel(
|
||||||
|
user.powerLevel >= 100
|
||||||
|
? user.powerLevel
|
||||||
|
: 100)),
|
||||||
),
|
),
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
value: null,
|
value: null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue