diff --git a/lib/view/pages/talk/components/chatBubble.dart b/lib/view/pages/talk/components/chatBubble.dart index d880f90..a351435 100644 --- a/lib/view/pages/talk/components/chatBubble.dart +++ b/lib/view/pages/talk/components/chatBubble.dart @@ -218,7 +218,7 @@ class _ChatBubbleState extends State { IconButton( onPressed: () { showDialog(context: context, builder: (context) { - return SimpleDialog( + return AlertDialog( contentPadding: const EdgeInsets.all(15), titlePadding: const EdgeInsets.only(left: 6, top: 15), title: Row( @@ -230,11 +230,69 @@ class _ChatBubbleState extends State { }, icon: const Icon(Icons.arrow_back), ), - const SizedBox( - width: 10, - height: 0, - child: null, + const SizedBox(width: 10), + const Text('Emoji auswählen'), + ], + ), + content: SizedBox( + width: 256, + height: 270, + child: Column( + children: [ + emojis.EmojiPicker( + config: emojis.Config( + height: 256, + swapCategoryAndBottomBar: true, + emojiViewConfig: emojis.EmojiViewConfig( + backgroundColor: Theme.of(context).canvasColor, + recentsLimit: 67, + emojiSizeMax: 19, + noRecents: const Text('Keine zuletzt verwendeten Emojis'), + ), + bottomActionBarConfig: emojis.BottomActionBarConfig( + showBackspaceButton: false, + backgroundColor: Theme.of(context).hoverColor.withAlpha(50), + buttonColor: Theme.of(context).dividerColor.withAlpha(70), + ), + categoryViewConfig: emojis.CategoryViewConfig( + backgroundColor: Theme.of(context).hoverColor, + iconColorSelected: Theme.of(context).primaryColor, + indicatorColor: Theme.of(context).primaryColor, + ), + searchViewConfig: emojis.SearchViewConfig( + backgroundColor: Theme.of(context).dividerColor, + buttonColor: Theme.of(context).dividerColor, + hintText: 'Suchen', + buttonIconColor: Colors.white, + ), + ), + onEmojiSelected: (emojis.Category? category, emojis.Emoji emoji) { + Navigator.of(context).pop(); + Navigator.of(context).pop(); + ReactMessage( + chatToken: widget.chatData.token, + messageId: widget.bubbleData.id, + params: ReactMessageParams(emoji.emoji), + ).run().then((value) => widget.refetch(renew: true)); + }, + ), + ], + ), + ), + ); + /*return SimpleDialog( + contentPadding: const EdgeInsets.all(15), + titlePadding: const EdgeInsets.only(left: 6, top: 15), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + IconButton( + onPressed: () { + Navigator.of(context).pop(); + }, + icon: const Icon(Icons.arrow_back), ), + const SizedBox(width: 10), const Text('Emoji auswählen'), ], ), @@ -242,11 +300,8 @@ class _ChatBubbleState extends State { Column( children: [ emojis.EmojiPicker( - onBackspacePressed: () { - null; - }, config: emojis.Config( - height: 256, + //height: 256, swapCategoryAndBottomBar: true, emojiViewConfig: emojis.EmojiViewConfig( backgroundColor: Theme.of(context).canvasColor, @@ -280,15 +335,11 @@ class _ChatBubbleState extends State { ).run().then((value) => widget.refetch(renew: true)); }, ), - const SizedBox( - width: 1, - height: 25, - child: null, - ) + const SizedBox(height: 25), ], ), ], - ); + );*/ }); }, style: IconButton.styleFrom(