From e8fcc7abc2d1b442b70fdaa888805208bbea404e 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 bcc2b3f1b..fc2260f72 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',