refs #23: add possibility to hide the attachment button

This commit is contained in:
Salvatore Giordano
2020-04-10 10:42:13 +02:00
parent 0cc047570a
commit e549ae89f7
+5 -1
View File
@@ -63,6 +63,7 @@ class MessageInput extends StatefulWidget {
this.editMessage, this.editMessage,
this.maxHeight = 150, this.maxHeight = 150,
this.keyboardType = TextInputType.multiline, this.keyboardType = TextInputType.multiline,
this.disableAttachments = false,
}) : super(key: key); }) : super(key: key);
/// Message to edit /// Message to edit
@@ -80,6 +81,9 @@ class MessageInput extends StatefulWidget {
/// The keyboard type assigned to the TextField /// The keyboard type assigned to the TextField
final TextInputType keyboardType; final TextInputType keyboardType;
/// If true the attachments button will not be displayed
final bool disableAttachments;
@override @override
_MessageInputState createState() => _MessageInputState(); _MessageInputState createState() => _MessageInputState();
} }
@@ -129,7 +133,7 @@ class _MessageInputState extends State<MessageInput> {
direction: Axis.horizontal, direction: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[ children: <Widget>[
_buildAttachmentButton(), if (!widget.disableAttachments) _buildAttachmentButton(),
_buildTextInput(context), _buildTextInput(context),
_animateSendButton(context), _animateSendButton(context),
], ],