Skip to content

Commit

Permalink
Autofill suggestion onSubmitted
Browse files Browse the repository at this point in the history
Prevent predictive text
  • Loading branch information
erdemyerebasmaz committed May 14, 2024
1 parent 0807aa7 commit e9e9e71
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ class RestoreFormPageState extends State<RestoreForm> {
final itemIndex = index + (6 * (widget.currentPage - 1));
return TypeAheadFormField(
textFieldConfiguration: TextFieldConfiguration(
autocorrect: false,
controller: widget.textEditingControllers[itemIndex],
textInputAction: TextInputAction.next,
onSubmitted: (text) {
widget.textEditingControllers[itemIndex].text = text;
onSubmitted: (text) async {
final suggestions = await _getSuggestions(text);
widget.textEditingControllers[itemIndex].text =
suggestions.length == 1 ? suggestions.first : text;
if (itemIndex + 1 < focusNodes.length) {
focusNodes[itemIndex + 1].requestFocus();
}
Expand Down

0 comments on commit e9e9e71

Please sign in to comment.