matanshukry / flutter_google_places_sdk

Flutter plugin for google places native sdk
32 stars 68 forks source link

[Feature Request] Ability to throttle search frequency on autocomplete #36

Closed 2shrestha22 closed 1 year ago

2shrestha22 commented 1 year ago

It forces the application to search constantly. Having the ability to control when the search fires (e.g. debouncing, if the input has more than 3 characters) would be good to save on both token usage/rate limits as well as bandwidth to/from the application.

matanshukry commented 1 year ago

@2shrestha22 what's stopping you from doing it now?

If you want the feature implemented at the library level - I'm not sure it's a good idea. There are many ways to do it, and it's unlikely you'll find a single way that all users of the library will want.

Probably better to simply a debounce before calling the method on the object this library is exposing.

2shrestha22 commented 1 year ago

Hi @matanshukry, you are correct. It's not a good idea to debounce Future and I was dumb raising this issue. Currently I am debouncing in a TextField, best solution I could find. Thank you for this great library.