I’m working on a Flutter project, which will run on an android device that already has a physical keyboard built in.
Does anyone know how to never display the on screen keyboard, and only accept data from the physical keyboard?
I’ve tried using TextInputType.none (do not enter any characters), among other methods that whenever I type something the keyboard is displayed again.
I need the on screen keyboard to never be displayed and the characters typed on the physical keyboard to be entered.
2
Answers
Thanks the first option worked.
And I added the TextEditingController inside a RawKeyboardListener, so every time there is a typing on the physical keyboard, the character will be added to the TextFormField.
There are two ways you can do this:
If you are using
TextFormField
widget:SystemChannels
class.For details, see this flutter issue: https://github.com/flutter/flutter/issues/16863