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