-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimum chars before sending request? #83
Comments
You can’t .. why not just get check the pattern length in the callback before and return an empty of previous result if not long enough?!
…Sent from my iPad
On Apr 6, 2019, at 3:14 AM, Thomas Wiradikusuma ***@***.***> wrote:
How do I set minimum chars before suggestionsCallback is triggered?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
That's actually a good idea. Thanks! |
@sjmcdowall can we reopen this one? Checking the pattern length fires an exception, even if the pattern is not empty (and not null): Code:
Result:
|
Fixed it with this:
Always making sure to return an empty list if no call. |
That's pretty interesting. I am going to make a fix that will allow returning null. If you return an empty list, then it will show the no items! box. If you return null, a suggestions box will not show at all. |
@KaYBlitZ have you implemented it at the end? |
@qbait @KaYBlitZ @claudelk @alphamikle I was using this version flutter_typeahead: ^1.7.0. This version was working fine but now i ugrade this to 3.1.1. now it is not showing any list. |
I think it's the null protection added in 3.x. You shouldn't really return a null but instead an empty set of whatever type UserData.getSuggestions(value) would return .. just make it an empty array or whatever of that type? |
UserData.getSuggestions its a just String Array. |
How do I set minimum chars before
suggestionsCallback
is triggered?The text was updated successfully, but these errors were encountered: