From f70717a98760e8367922b660b438d148344d1ad6 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 12 Mar 2021 16:21:45 +0100 Subject: [PATCH] Hide useless menu options --- lib/ui/tiles/conversation_message_tile.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ui/tiles/conversation_message_tile.dart b/lib/ui/tiles/conversation_message_tile.dart index cdae381..d1da64d 100644 --- a/lib/ui/tiles/conversation_message_tile.dart +++ b/lib/ui/tiles/conversation_message_tile.dart @@ -70,7 +70,7 @@ class ConversationMessageTile extends StatelessWidget { user: userInfo, width: 35.0, ), - itemBuilder: (c) => [ + itemBuilder: (c) => >[ PopupMenuItem( enabled: (message.message?.content ?? "") != "", value: _MenuChoices.COPY_MESSAGE, @@ -101,7 +101,7 @@ class ConversationMessageTile extends StatelessWidget { value: _MenuChoices.DELETE, child: Text(tr("Delete")), ), - ], + ]..removeWhere((element) => !element.enabled), onSelected: _menuOptionSelected, ), );