From b71dd4bc08123fa9abcfabe9d0a8e2016939c558 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 24 Jul 2021 10:52:54 +0200 Subject: [PATCH] fix: Hide stickers button when there is not sticker pack --- lib/pages/views/chat_view.dart | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/pages/views/chat_view.dart b/lib/pages/views/chat_view.dart index bcc2b3f1..fc2260f7 100644 --- a/lib/pages/views/chat_view.dart +++ b/lib/pages/views/chat_view.dart @@ -626,20 +626,24 @@ class ChatView extends StatelessWidget { contentPadding: EdgeInsets.all(0), ), ), - PopupMenuItem( - value: 'sticker', - child: ListTile( - leading: CircleAvatar( - backgroundColor: Colors.orange, - foregroundColor: Colors.white, - child: Icon(Icons - .emoji_emotions_outlined), + if (controller.room + .getImagePacks( + ImagePackUsage.sticker) + .isNotEmpty) + PopupMenuItem( + value: 'sticker', + child: ListTile( + leading: CircleAvatar( + backgroundColor: Colors.orange, + foregroundColor: Colors.white, + child: Icon(Icons + .emoji_emotions_outlined), + ), + title: Text( + L10n.of(context).sendSticker), + contentPadding: EdgeInsets.all(0), ), - title: Text( - L10n.of(context).sendSticker), - contentPadding: EdgeInsets.all(0), ), - ), if (PlatformInfos.isMobile) PopupMenuItem( value: 'voice',