From eb3d356407cd483456d5ae72a10b36f25d26556f Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Mon, 13 Sep 2021 15:16:04 +0530 Subject: [PATCH] general fixes --- .../lib/src/message_input.dart | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/message_input.dart b/packages/stream_chat_flutter/lib/src/message_input.dart index a6795a9e..296fb889 100644 --- a/packages/stream_chat_flutter/lib/src/message_input.dart +++ b/packages/stream_chat_flutter/lib/src/message_input.dart @@ -477,19 +477,19 @@ class MessageInputState extends State { _emojiOverlay != null || _mentionsOverlay != null, overlayBuilder: (context, offset) { - late Widget child; + late Widget? child; if (_commandsOverlay != null) { - child = _buildCommandsOverlayEntry(); + child = _commandsOverlay; } else if (_emojiOverlay != null) { - child = _buildEmojiOverlay(); + child = _emojiOverlay; } else { - child = _buildMentionsOverlayEntry(); + child = _mentionsOverlay; } return CenterAbout( position: Offset(offset.dx, offset.dy), - child: child, + child: child!, ); }, child: child, @@ -827,14 +827,6 @@ class MessageInputState extends State { .keyStroke(widget.parentMessage?.id) .catchError((e) {}); - setState(() { - _actionsShrunk = s.trim().isNotEmpty && - ((widget.actions?.length ?? 0) + - (widget.showCommandsButton ? 1 : 0) + - (widget.disableAttachments ? 0 : 1) > - 1); - }); - _commandsOverlay = null; _mentionsOverlay = null; _emojiOverlay = null; @@ -844,6 +836,14 @@ class MessageInputState extends State { _checkMentions(s, context); _checkEmoji(s, context); + + setState(() { + _actionsShrunk = s.trim().isNotEmpty && + ((widget.actions?.length ?? 0) + + (widget.showCommandsButton ? 1 : 0) + + (widget.disableAttachments ? 0 : 1) > + 1); + }); }, ); }