Add debounce in Autocomplete widget#125855
Add debounce in Autocomplete widget#1258552shrestha22 wants to merge 1 commit intoflutter:masterfrom
Conversation
|
Thanks for opening this issue and PR. I meant to do a better job showing how to do things like debouncing more easily, but I never got around to it. I went ahead and opened a PR with an example of doing debouncing now, without the change in your PR: #126283. I think my current opinion is that we shouldn't add a built-in way to do this like you're suggesting, and instead we should just do a better job explaining how to do debouncing etc. on your own. I worry about bloating the number of parameters and making Autocomplete opinionated about how debouncing should work. What do you think after looking at the example in my PR? Does that cover your use case? |
|
Thank you @justinmc for the example. It covers my use case. By providing an example in the documentation, users will not struggle to find a working solution. |
|
Alright sounds good, let's go ahead and close this PR. If more people end up finding your issue and still asking for a built-in debounce, then I'll come back to this PR. |
|
I came across this because I was looking for a way to debounce my requests. The example solution works so I've implemented that. My two cents about it though is that it's a pretty complex solution (I, at least, found it a little difficult to follow) that could be implemented into the AutoComplete class. Either way, thanks for considering this PR and also thanks for adding the example in the docs. Much appreciated. |
This PR will add ability to debounce
Autocompletewidget by only calling options builder when needed. It is useful to limit API requests.List which issues are fixed by this PR. You must list at least one issue.
#125857
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.