简体   繁体   English

Flutter:实现Material Search栏以从服务器异步中搜索数据

[英]Flutter: Implement Material Search bar to search data from a server async

I am trying to implement material search in my flutter app using the SearchDelegate class. 我正在尝试使用SearchDelegate类在flutter应用程序中实现材料搜索。

I have implemented this with a local list of items. 我已经用本地项目列表实现了这一点。 How can I use this to get list of items from a REST API asynchronously. 如何使用它以异步方式从REST API获取项目列表。 I already have an API which gives the list of items for a given string. 我已经有一个API,该API给出了给定字符串的项目列表。 I just need to know how to do it asynchronously using the SearchDelegate class in Flutter. 我只需要知道如何使用Flutter中的SearchDelegate类异步进行操作即可。

您应该尝试FutureBuilder在这里看看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM