I am creating an app intended to be used on PDAs(mobile computer) devices using flutter. Part of the requirement is that the on-screen keyboard shouldn't pop-up while focusing on the field, the physical keyboard will be used in its stead.
I was trying to make it such that as soon as a field is focused it will simulate the back key or KEY_UP action but I couldn't find the code for it. I tried https://api.flutter.dev/flutter/flutter_test/simulateKeyUpEvent.html this page but the dependencies for it doesn't resolve.
Is there any way I can do this ?
EDIT 1:
Some more things that I tried are: This link How to hide soft input keyboard on flutter after clicking outside TextField/anywhere on screen? It actually does not related to my problem as it hides the keyboard but doesn't allow editing anymore.
I also tried using
SystemChannels.textInput.invokeMethod('TextInput.hide');
This one is actually good. It hides the keyboard and also allows to use physical keyboard/ Scanner for input. But the problem with that is when I put it in onTap it requires to be in focus to be able to put the keyboard back and if the fields are on autofocus then while Navigating to the page, the soft-keyboard will already be open. I tried extending FocusNode and overriding the requestFocus method like this.
class NoKeyboardTextFocusNode extends FocusNode {
@override
void requestFocus([FocusNode node]) {
super.requestFocus(node);
SystemChannels.textInput.invokeMethod('TextInput.hide');
}
}
This too didnt help. I want to make it such that as soon as the field has focus, the TextInput.hide line will be executed