fix messageinput

This commit is contained in:
Salvatore Giordano
2021-05-17 11:30:05 +02:00
parent 625c2f0ad2
commit 2263dc097b
@@ -463,7 +463,9 @@ class MessageInputState extends State<MessageInput> {
); );
} }
Widget _buildExpandActionsButton() => Padding( Widget _buildExpandActionsButton() {
final channel = StreamChannel.of(context).channel;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8), padding: const EdgeInsets.symmetric(horizontal: 8),
child: AnimatedCrossFade( child: AnimatedCrossFade(
crossFadeState: _actionsShrunk crossFadeState: _actionsShrunk
@@ -500,12 +502,8 @@ class MessageInputState extends State<MessageInput> {
if (!widget.disableAttachments) _buildAttachmentButton(), if (!widget.disableAttachments) _buildAttachmentButton(),
if (widget.showCommandsButton && if (widget.showCommandsButton &&
widget.editMessage == null && widget.editMessage == null &&
StreamChannel.of(context) channel.state != null &&
.channel channel.config?.commands.isNotEmpty == true)
.config
?.commands
.isNotEmpty ==
true)
_buildCommandButton(), _buildCommandButton(),
...widget.actions ?? [], ...widget.actions ?? [],
].insertBetween(const SizedBox(width: 8)), ].insertBetween(const SizedBox(width: 8)),
@@ -515,6 +513,7 @@ class MessageInputState extends State<MessageInput> {
alignment: Alignment.center, alignment: Alignment.center,
), ),
); );
}
Expanded _buildTextInput(BuildContext context) { Expanded _buildTextInput(BuildContext context) {
final theme = StreamChatTheme.of(context); final theme = StreamChatTheme.of(context);