flutter-autocomplete-textfield icon indicating copy to clipboard operation
flutter-autocomplete-textfield copied to clipboard

option to append suggestion to textField rather than replacing its content

Open matteoandreozzi opened this issue 5 years ago • 0 comments

                                    `String newText = suggestion.toString();
                                    if (submitOnSuggestionTap) {
                                    textField.focusNode.unfocus();
                                    itemSubmitted(suggestion);
                                    if (clearOnSubmit) {
                                      clear();
                                    }
                                  } else {
                                    String newText = suggestion.toString();

                                    textChanged(newText);
                                  }
                                    textField.controller.text = 
                                        appendOnTap?  textField.controller.text +newText: newText;`                                                                               

I think it would be really useful if something like the above snippet was implemented in updateOverlay , as it would allow for implementing "suggest as you type" kind of text areas with filters like the one below, which matches last typed single words with the suggestions list: itemFilter: (item, query) { return item .toLowerCase() .startsWith(query.toLowerCase().split(' ').last); },

matteoandreozzi avatar May 14 '20 16:05 matteoandreozzi