Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter How to always hide keyboard when click on TextField but keep focus(Keep show cursor)

I can't control keyboard show or hide, In my project I need to always hide keyboard but keep focused to display my custom keyboard(a widget).

This is I want

And this is my problem

like image 957
quyen phong tran vuong Avatar asked Mar 19 '19 05:03

quyen phong tran vuong


People also ask

How do you hide soft input keyboard on Flutter after clicking outside TextField anywhere on screen?

you just need to wrap your whole screen in the GestureDetector method and onTap method write this code. return GestureDetector( onTap: () => FocusManager. instance.

How do you hide the counter in TextField Flutter?

You can hide the counter by adding counterText: '' , inside the textfield decoration. It will simply display an empty String. Show activity on this post. Simply set counter to Offstage() will do the trick.


1 Answers

To hide keyboard and keep the cursor visible, set readOnly to true and showCursor to true.

TextFormField(   showCursor: true,   readOnly: true), 

See flutter/issues/#16863

like image 113
Karen Avatar answered Sep 22 '22 03:09

Karen