Revolution #1
1 changed files with 15 additions and 3 deletions
|
|
@ -799,16 +799,28 @@ class UsersListPanel extends GetView<UserListPanelController> {
|
||||||
|
|
||||||
final isAdmin =
|
final isAdmin =
|
||||||
adminList.any((element) => element.id == user.id);
|
adminList.any((element) => element.id == user.id);
|
||||||
if (isAdmin) return const SizedBox();
|
|
||||||
|
|
||||||
return ElevatedButton.icon(
|
final isCurrentUser =
|
||||||
|
user.accessToken == ApiController.to.token;
|
||||||
|
if (isCurrentUser) return const SizedBox();
|
||||||
|
|
||||||
|
final btn = ElevatedButton.icon(
|
||||||
onPressed: () => controller.deleteUser(user),
|
onPressed: () => controller.deleteUser(user),
|
||||||
icon: const Icon(Icons.delete_forever),
|
icon: const Icon(Icons.delete_forever),
|
||||||
label: const Text("Delete user"),
|
label: const Text("Delete user"),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Colors.redAccent,
|
backgroundColor: Colors.redAccent,
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (isAdmin) {
|
||||||
|
return Tooltip(
|
||||||
|
message: "Please note that this user is an admin",
|
||||||
|
child: btn,
|
||||||
).paddingAll(8).expanded();
|
).paddingAll(8).expanded();
|
||||||
|
}
|
||||||
|
|
||||||
|
return btn.paddingAll(8).expanded();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue