From b5b35031d9aa5455598dc3ed704bec196ce15efa Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Mon, 7 Dec 2020 13:08:11 +0100 Subject: [PATCH] fix messageinput autofocus --- .vscode/launch.json | 19 +++++++++++++++++++ lib/src/message_input.dart | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..eb658d4d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,19 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "stream-chat-flutter", + "request": "launch", + "type": "dart" + }, + { + "name": "example", + "cwd": "example", + "request": "launch", + "type": "dart" + } + ] +} \ No newline at end of file diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index fefb5209..6836d466 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -95,7 +95,7 @@ class MessageInput extends StatefulWidget { this.attachmentThumbnailBuilders, this.inputTextStyle, this.attachmentIconColor, - this.autofocus, + this.autofocus = false, }) : super(key: key); /// Message to edit @@ -262,7 +262,7 @@ class MessageInputState extends State { }); }, style: widget.inputTextStyle ?? Theme.of(context).textTheme.bodyText2, - autofocus: widget.autofocus ?? false, + autofocus: widget.autofocus, decoration: InputDecoration( hintText: 'Write a message', hintStyle: