fix messageinput overflow when no action is available

This commit is contained in:
Salvatore Giordano
2021-05-05 12:36:13 +02:00
parent 95f849e442
commit 660bae3583
@@ -482,25 +482,29 @@ class MessageInputState extends State<MessageInput> {
), ),
splashRadius: 24, splashRadius: 24,
), ),
secondChild: FittedBox( secondChild: widget.disableAttachments &&
child: Row( !widget.showCommandsButton &&
crossAxisAlignment: CrossAxisAlignment.center, widget.actions?.isNotEmpty != true
mainAxisAlignment: MainAxisAlignment.spaceEvenly, ? Offstage()
children: <Widget>[ : FittedBox(
if (!widget.disableAttachments) _buildAttachmentButton(), child: Row(
if (widget.showCommandsButton && crossAxisAlignment: CrossAxisAlignment.center,
widget.editMessage == null && mainAxisAlignment: MainAxisAlignment.spaceEvenly,
StreamChannel.of(context) children: <Widget>[
.channel if (!widget.disableAttachments) _buildAttachmentButton(),
.config if (widget.showCommandsButton &&
?.commands widget.editMessage == null &&
.isNotEmpty == StreamChannel.of(context)
true) .channel
_buildCommandButton(), .config
...widget.actions ?? [], ?.commands
].insertBetween(const SizedBox(width: 8)), .isNotEmpty ==
), true)
), _buildCommandButton(),
...widget.actions ?? [],
].insertBetween(const SizedBox(width: 8)),
),
),
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
alignment: Alignment.center, alignment: Alignment.center,
), ),