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,20 +95,21 @@ class ConversationTile extends StatelessWidget {
], ],
), ),
// Trailing information onLongPressOpenMenu: (position) {
trailing: PopupMenuButton<_PopupMenuChoices>( showMenu<_PopupMenuChoices>(
itemBuilder: (b) => <PopupMenuEntry<_PopupMenuChoices>>[ context: context,
PopupMenuItem( position: position,
child: Text(tr("Update")), items: [
value: _PopupMenuChoices.UPDATE, PopupMenuItem(
), child: Text(tr("Update")),
PopupMenuItem( value: _PopupMenuChoices.UPDATE,
child: Text(tr("Delete")), ),
value: _PopupMenuChoices.DELETE, PopupMenuItem(
) child: Text(tr("Delete")),
], value: _PopupMenuChoices.DELETE,
onSelected: _conversationMenuCallback, )
), ]).then(_conversationMenuCallback);
},
); );
} }