how to know when the user completes the text field flutter,
for example, i need to apply a logic, When user complete the textformfeild,I tried oneditingCompleted method, but its not working, so please share the how do this one
how to know when the user completes the text field flutter,
for example, i need to apply a logic, When user complete the textformfeild,I tried oneditingCompleted method, but its not working, so please share the how do this one
2
Answers
It depends on how you define "COMPLETE". What is "complete"? Is it when user press Enter? Is it when some text exists on the form? If I want to write Harry Potter in that form, what is the completion? Is it when Voldemort dies, or Severus Albus Potter gets on the train? Please provide more information.
In case of user press enter is defined as completion, use can use
onSubmit
. You can combine it withvalidator
to ensure user types something there.You can detect when a user completes entering text in a
TextFormField
widget by utilizing theonFieldSubmitted
property.