flutterdartsearchsearchbarflutter-textformfield

how to know user stopped typing in text field() to call search api in flutter


I want to stop searching for every words in onchanged() textfield and also tried searchdelete same action happening here . so I want to search in set of words or when stop typing. and call api request Any other way to search


Solution

  • You can listen to onSubmitted or onEditingComplete

    onSubmitted → ValueChanged? Called when the user indicates that they are done editing the text in the field. [...] final

    The onEditingComplete callback also runs when the user finishes editing. It's different from onSubmitted because it has a default value which updates the text controller and yields the keyboard focus. Applications that require different behavior can override the default onEditingComplete callback.