How to delete continuously delete text in a TextFormField when the backspace is kept down? - flutter

I got a TextFormField controlled by a TextEditingController. I have found no way to remove continuously, one by one, all the characters on the field if the user keeps the backspace pressed on mobile.
The behavior should be similar to what you would expect when writing an email, or text in a document, etc.

Related

There's a bug when pressing on the textformfield

I'm getting this box when trying to press on the textformfield, it's rarely to happened by it look like a bug and it sticks to the screen even if I navigate to a different screen until I restart the app it disappears, did anyone faced something like this ?
This comes due to long press over text field,
If you want to avoid this you have to pass enableInteractiveSelection: false which avoids copy and paste and other interaction from user

Close keyboard on a multi-line form (Pixel2)

Messing around with flutter and I must be missing it in the documentation somewhere because I'm not sure what this object or property is.
I am trying to use a multiline textformfield, and so to handle focus I've used
onTap: (){FocusScope.of(context).requestFocus(new FocusNode());},
What I've noticed is that I need to doubletap to reenter the form field now.
When I do double tap, I get this odd label/hint -- How can I remove or prevent it from showing?
Hint/Label?
Any info is appreciated :)
Edit: The reason I needed to double tap was because multi-line form fields switch the Pixel2 GO button to the newline button and prevents the user from exiting the keyboard cleanly.
Fixed by adding textInputAction: TextInputAction.go to the textformfield
If you just want to have the TextFormField work normally, you don't have to write your own onTap function. The built-in one works perfectly fine :)

Setting Widget Focus in Gtkada

I'm trying to create a simple test program in Gtkada to bring up a Dialog box upon leaving a specific textbox. I have managed this part, but am having problems resetting the focus back to the original textbox when the Dialog's 'Ok' button is pressed.
The general idea is that the user enters something into a textbox and when they click/tab out of the box (focus out event), some simple Alphanumeric validation is done. If the validation fails, the user is warned with a Dialog, and focus is returned to the textbox they entered erroneous data into.
All I am after is a simple example of how to set the focus back to a textbox when you close the Dialog box which clicking out of the textbox originally called. In Gtkada... I'm using version 2.2 of Gtkada. I can't change the version of Gtkada, or use a different program or language!
Much obliged!
Tim
The most elegant solution, GUI-wise, is to do the validation on a leave_event on each input field, and if that fails display an error message (in red or some such) next to the field. But do not display a dialog or force the focus to a specific field, that would interfere with what the user is trying to do (imagine: I enter an incorrect email address, press tab, get the dialog which I do not read (like most users), start typing my name for the next field, but since the focus went back to the email address, I have no overridden that one and lost my previous input).
If you still want to grab the focus, Gtk.Widget.Grab_Focus is the procedure you want.

Detect back space for secure text field. Delegate method for detecting backspace key

Possible duplicate Detect backspace in UITextField
I am having 5 secure password text field which accepts 1 character each. When you enter 1 character in a text field then the next textfield becomes first responder. The problem occurs when i press "BACK SPACE" button.
My requirement is : When i press back button in an empty text field, it should detect the backspace button press and cursor should navigate to the previous text field and previous text field becomes first responder.
What is happening is when i press the back button in an empty text field, the back space is not detected and it stays in the same empty text field.
As suggested in this link Detect backspace in UITextField i have tried putting zero width space character \u200B white editing did begin but it takes it as character and becomes visible in text field. Any help is highly appreciated.
The following link have a solution from Jacob Caraballo which helped me solve my problem,
Detect backspace in UITextField

track user input from UIKeyboard

How can I get user input of the UIKeyboard on the iPhone?
I want to track, if the user hits "backspace" when the firstResponder UITextField is empty.
I know how I can track a text change but if the field is empty the text don't change when hit "backspace".
You can put a single space character as the default textfield text. If it tries to disappear in your textshouldchange delegate then the user hit a backspace. You can remove the leading space before actually using the text result.