From 8e64f9d3831a326f782373fdc99b63998e00a218 Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Thu, 25 Feb 2021 13:39:29 +0530 Subject: [PATCH] fix: Commands overflow bug --- .../lib/src/message_input.dart | 28 ++++++++++--------- 1 file changed, 15 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 26feba69..52223e7e 100644 --- a/packages/stream_chat_flutter/lib/src/message_input.dart +++ b/packages/stream_chat_flutter/lib/src/message_input.dart @@ -417,19 +417,21 @@ class MessageInputState extends State { ), splashRadius: 24, ), - secondChild: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - if (!widget.disableAttachments) _buildAttachmentButton(), - if (widget.editMessage == null && - StreamChannel.of(context) - .channel - ?.config - ?.commands - ?.isNotEmpty == - true) - _buildCommandButton(), - ].insertBetween(const SizedBox(width: 8)), + secondChild: FittedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + if (!widget.disableAttachments) _buildAttachmentButton(), + if (widget.editMessage == null && + StreamChannel.of(context) + .channel + ?.config + ?.commands + ?.isNotEmpty == + true) + _buildCommandButton(), + ].insertBetween(const SizedBox(width: 8)), + ), ), duration: Duration(milliseconds: 300), alignment: Alignment.center,