-1

I am running my flutter app on a Debian with Openbox (X11). When i touch a TextField, the keyboard doesn't appear.

I have tried to request the focus and set the autofocus: true on the TextField but it doesn't work either. It works fine on my iOS / Android devices.

Is this supported by flutter for X11 backends ? Should i install some keyboard package on my Debian so flutter can use it ?

Thanks in advance !

Tom3652
  • 2,540
  • 3
  • 19
  • 45
  • Do you have a physical keyboard connected to the Debian device? – Piotr Sep 08 '22 at 12:07
  • No i would like to use the `soft` keyboard as it appears in VMs or emulators. My debian device is a tablet that looks like an iPad Sorry if this is confusing – Tom3652 Sep 08 '22 at 13:26
  • 1
    I think I get what you're trying to achieve. Unfortunately I think there is no easy way out. In my flutter linux projects I used my own on screen keyboard with it's own controller written from 0. You could try to extend (material) keyboard behaviour in your app and set inputdevices to touch and not keyboard maybe that will force flutter's keyboard to pop up. But other than that custom keyboard would be your best bet. – Piotr Sep 08 '22 at 14:32
  • thank you very much for your answer. I was actually thinking about this alternative, meaning calling a custom keyboard when a `TextField` is tapped. By "my own on screen keyboard", do you mean that you render a Flutter view that you have coded that looks like a Keyboard and handle all the touch input events yourself ? Well done already for your work even if it's not this. I was thinking about pushing a debian keyboard such as `onboard` instead from the Flutter code... But i don't know yet how to achieve this. – Tom3652 Sep 08 '22 at 14:59
  • I don't think pushing for system keyboard would do much in that case. Even in terms of app optimisation. But that's another possible solution. In my case it's simply when textfield focusNode has focus there's a function pushing my custom keyboard on screen no matter what as a layer on top of what is currently on screen. That way it does not collide with currently displayed view. – Piotr Sep 08 '22 at 15:10
  • Alright i got it thanks for the explanations ! One last thing, is your custom keyboard a standard Flutter API or class ? Extending the Material keyboard ? – Tom3652 Sep 08 '22 at 16:17
  • 1
    It's a basic class with some material functionality on it like inkwell effects on keytaps added manually. It's really bare bones in my case. – Piotr Sep 08 '22 at 16:21
  • No problem, If I post it as an answer will you mark it as answer you were looking for? – Piotr Sep 09 '22 at 06:55
  • Actually yes, your solution of building a custom keyboard in flutter is the best solution. – Tom3652 Sep 09 '22 at 08:21

2 Answers2

1

I think I get what you're trying to achieve. Unfortunately I think there is no easy way out. In my flutter linux projects I used my own on screen keyboard with it's own controller written from 0. You could try to extend (material) keyboard behaviour in your app and set inputdevices to touch and not keyboard maybe that will force flutter's keyboard to pop up. But other than that custom keyboard would be your best bet.

I don't think pushing for system keyboard would do much in that case. Even in terms of app optimisation. But that's another possible solution. In my case it's simply when textfield focusNode has focus there's a function pushing my custom keyboard on screen no matter what as a layer on top of what is currently on screen. That way it does not collide with currently displayed view.

It can be a basic class with some material functionality on it like inkwell effects on keytaps added manually. It's really bare bones in my case.

Piotr
  • 545
  • 4
  • 13
  • please, do you have any code that you can share? Thank you – Jaime Roman Oct 19 '22 at 18:08
  • I can't share the code since it's for my client, but you can achieve this by using `GridView`s and multiple `VoidCallback` object + `InkWell` to have a responding UI keyboard on each tile of the grid. It works perfectly in my case. – Tom3652 Oct 21 '22 at 15:14
1

You can use "new_virtual_keyboard" package, this worked for me in a raspbian os.

Edit

Here is a list of the other packages

Jaime Roman
  • 749
  • 1
  • 11
  • 26
  • 1
    I am upvoting this because it seems to be a good alternative for people who don't have the time to build their own keyboard. – Tom3652 Oct 21 '22 at 15:12