'flutter autocomplete using two lists how to prioritise first list
I have two String lists. A short list and a long list. The short list is a subset of the long list. I want to use autocomplete on a text field that will give me all of the matching strings from the short list and then underneath these all of the matching strings from the long list. I will be using startsWith. Here is an example:
Short list
aardvark, buffalo, cat, dog, gerbil, tiger.
Long list
aardvark, ant eater, bear, beaver, bee, bird, buffalo, canary, cat, cheetah, dog, gerbil, tiger .....
So pressing "b" will return buffalo from the short list and then bear beaver bee bird (but not gerbil because of the startsWith filter).
I cannot find a way to do this with one call to autocomplete.
Thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|