Make public autofocus field of the TextField of message_input

This commit is contained in:
Oleksandr Bezpalchuk
2020-12-07 12:21:11 +02:00
parent a20409c534
commit 5d35551a00
+5 -1
View File
@@ -95,6 +95,7 @@ class MessageInput extends StatefulWidget {
this.attachmentThumbnailBuilders,
this.inputTextStyle,
this.attachmentIconColor,
this.autofocus,
}) : super(key: key);
/// Message to edit
@@ -103,6 +104,9 @@ class MessageInput extends StatefulWidget {
/// Message to start with
final Message initialMessage;
/// If set true TextField will be active by default. Default is false.
final bool autofocus;
/// Function called after sending the message
final void Function(Message) onMessageSent;
@@ -258,7 +262,7 @@ class MessageInputState extends State<MessageInput> {
});
},
style: widget.inputTextStyle ?? Theme.of(context).textTheme.bodyText2,
autofocus: false,
autofocus: widget.autofocus ?? false,
decoration: InputDecoration(
hintText: 'Write a message',
hintStyle: