1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 12:59:21 +00:00

Hide useless menu options

This commit is contained in:
Pierre HUBERT 2021-03-12 16:21:45 +01:00
parent e02ab259b6
commit f70717a987

View File

@ -70,7 +70,7 @@ class ConversationMessageTile extends StatelessWidget {
user: userInfo, user: userInfo,
width: 35.0, width: 35.0,
), ),
itemBuilder: (c) => [ itemBuilder: (c) => <PopupMenuItem<_MenuChoices>>[
PopupMenuItem( PopupMenuItem(
enabled: (message.message?.content ?? "") != "", enabled: (message.message?.content ?? "") != "",
value: _MenuChoices.COPY_MESSAGE, value: _MenuChoices.COPY_MESSAGE,
@ -101,7 +101,7 @@ class ConversationMessageTile extends StatelessWidget {
value: _MenuChoices.DELETE, value: _MenuChoices.DELETE,
child: Text(tr("Delete")), child: Text(tr("Delete")),
), ),
], ]..removeWhere((element) => !element.enabled),
onSelected: _menuOptionSelected, onSelected: _menuOptionSelected,
), ),
); );