You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Flutter Development (flutter-dev)
Hello
I want to use the new AutoComplete class (https://api.flutter.dev/flutter/material/Autocomplete-class.html) but it's stretching my limited knowledge of futures. I need to specify an optionsBuilder which returns an Iterable<T> which is then used in optionsViewBuilder to build the dropdown selection list. The examples in the documentation and what I've found online (e.g. https://www.woolha.com/tutorials/flutter-using-autocomplete-widget-examples) do this synchronously. I want to get the optionsBuilder content from an API. How can I specify the AutoComplete constructor to work asynchronously?
In the meantime I have implemented a solution with the https://pub.dev/packages/flutter_typeahead package - that accepts an async callback in the equivalent place. Any tips about the way forward with AutoComplete would be greatly appreciated.