Skip to content
Snippets Groups Projects
Commit 41f6bf49 authored by Leon Tappe's avatar Leon Tappe :fire:
Browse files

unify look of ListTiles

parent ef52fbd7
No related branches found
No related tags found
No related merge requests found
......@@ -79,15 +79,25 @@ class _UsersPageState extends State<UsersPage> {
(User user) => CardListTile(
leading: Icon(user.scope == 'admin' ? Icons.verified_user : Icons.person),
title: Text(user.fullName),
onLongPress: () => showDialog(
context: context,
builder: (BuildContext context) => SimpleDialog(
children: [
ListTile(
enabled: user.username != Provider.of<AuthApi>(context).user?.username,
title: const Text('Löschen'),
onTap: () async {
Navigator.of(context).pop();
await _onDeleteUser(user);
},
),
],
),
),
actions: [
if (user.username != Provider.of<AuthApi>(context).user?.username)
IconButton(
onPressed: () => _onDeleteUser(user),
icon: const Icon(Icons.delete_forever_rounded),
),
IconButton(
onPressed: () => _onEditUser(user: user),
icon: const Icon(Icons.settings),
icon: const Icon(Icons.edit),
),
],
),
......@@ -122,7 +132,7 @@ class _UsersPageState extends State<UsersPage> {
}
}
void _onDeleteUser(User user) async {
Future<void> _onDeleteUser(User user) async {
final result = await showDialog(
context: context,
builder: (BuildContext context) => DeleteDialog(name: user.username),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment