From e549ae89f7b40f456e6ba232dd9bc472346f877a Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 10 Apr 2020 10:42:13 +0200 Subject: [PATCH] refs #23: add possibility to hide the attachment button --- lib/src/message_input.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 6c9c4c32..7049c68b 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -63,6 +63,7 @@ class MessageInput extends StatefulWidget { this.editMessage, this.maxHeight = 150, this.keyboardType = TextInputType.multiline, + this.disableAttachments = false, }) : super(key: key); /// Message to edit @@ -80,6 +81,9 @@ class MessageInput extends StatefulWidget { /// The keyboard type assigned to the TextField final TextInputType keyboardType; + /// If true the attachments button will not be displayed + final bool disableAttachments; + @override _MessageInputState createState() => _MessageInputState(); } @@ -129,7 +133,7 @@ class _MessageInputState extends State { direction: Axis.horizontal, crossAxisAlignment: CrossAxisAlignment.end, children: [ - _buildAttachmentButton(), + if (!widget.disableAttachments) _buildAttachmentButton(), _buildTextInput(context), _animateSendButton(context), ],