1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-26 06:49:22 +00:00

Change the way menu appear in conversations list screen

This commit is contained in:
Pierre HUBERT 2020-05-09 07:14:38 +02:00
parent 6cb9fd97e2
commit 5ccd3d4884

View File

@ -1,6 +1,7 @@
import 'package:comunic/helpers/conversations_helper.dart';
import 'package:comunic/lists/users_list.dart';
import 'package:comunic/models/conversation.dart';
import 'package:comunic/ui/widgets/custom_list_tile.dart';
import 'package:comunic/utils/date_utils.dart';
import 'package:comunic/utils/intl_utils.dart';
import 'package:comunic/utils/ui_utils.dart';
@ -52,7 +53,7 @@ class ConversationTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListTile(
return CustomListTile(
onTap: () => onOpen(conversation),
// Conversation name
title: Text(
@ -94,20 +95,21 @@ class ConversationTile extends StatelessWidget {
],
),
// Trailing information
trailing: PopupMenuButton<_PopupMenuChoices>(
itemBuilder: (b) => <PopupMenuEntry<_PopupMenuChoices>>[
PopupMenuItem(
child: Text(tr("Update")),
value: _PopupMenuChoices.UPDATE,
),
PopupMenuItem(
child: Text(tr("Delete")),
value: _PopupMenuChoices.DELETE,
)
],
onSelected: _conversationMenuCallback,
),
onLongPressOpenMenu: (position) {
showMenu<_PopupMenuChoices>(
context: context,
position: position,
items: [
PopupMenuItem(
child: Text(tr("Update")),
value: _PopupMenuChoices.UPDATE,
),
PopupMenuItem(
child: Text(tr("Delete")),
value: _PopupMenuChoices.DELETE,
)
]).then(_conversationMenuCallback);
},
);
}