flutter_chat_ui
flutter_chat_ui copied to clipboard
SendButtonVisibilityMode.editing: send button not added after typing on samsung keyboard
i am using InputOptions with sendButtonVisibilityMode: SendButtonVisibilityMode.editing (show the button when trimmed text is not empty). This is working fine with gboard. But with samsung keyboard, button is not becoming visible after i type some characters (only after i close the keyboard). I could reproduce this on 2 different devices and when i switch to gboard, everything works fine. I added onTextChanged and it is called after every character typed with both keyboards. So, i do not understand why the button is not updated. This might be a bug in TextEditingController, but even if so, we need a workaround here.
I faced the same problem on Xiaomi The button appears after closing the keyboard, or after adding a space
could you try one thing - there is this textEditingController
that kind of transforms input text with a simple markdown - could you disable it using inputOptions
and pass Flutter's own TextEditingController()
to the textEditingController
option? cause otherwise code is pretty straightforward,textEditingController.text != ''
thanks a lot for your answer. I tried like this:
Chat(... , inputOptions: InputOptions(textEditingController: TextEditingController(), )
without any change (working fine with gboard, send button not visible on samsung keyboard until keyboard closed or space added.
so it didn't help right? can you just build a simple flutter text field with controller and try it on your device? might be a bug in flutter? cause after this change it seems like there is no other logic..
here is my workaround - looks like a flutter bug:
TextEditingController textController = TextEditingController();
inputOptions: InputOptions(
onTextChanged: (text) {
setState(() {
textController.text = text;
});
},
textEditingController: textController,
...
i also tried textController.notifyListeners() without success.
ah so I need to call setState? will keep this in mind for v2
have the same issue on s23 plus with swiftkey (haven't checked other devices)