dart - Flutter FilterChip _cast 列表从端点动态加载
问题描述
我在这里找到的示例中使用示例代码:https ://docs.flutter.io/flutter/material/FilterChip-class.html
在示例代码中,_cast
是一个final
列表。
要使_cast
列表由来自端点的列表响应填充,需要进行哪些更改?
我做了什么?
我尝试过使用FutureBuilder
,但无论出于何种未知原因,返回的都不会作为快照future
传递。builder
https://gist.github.com/seanmavley/0a5f5190272c4f1a60b5a47203a06746
解决方案
尝试以下代码
List<ActorFilterEntry> _castList;
loadInterest() async {
...
setState(() {
_castEntry = res['interest'];
});
}
推荐阅读
- reactjs - Universal React Redux Starter Kit 中的 Ant Design 集成
- function - MapleSoft:反函数难题的解决方案
- javascript - 如何使用 jQuery 展开/折叠嵌套的 div
- scala - 为什么在 Scio 中您更喜欢聚合而不是 groupByKey?
- kentico - Kentico 智能搜索结果突然返回空
- facebook - Facebook 即时游戏中与 Phaser 一起使用的区域的正确大小是多少
- sql - 如果 GROUPED 值在源中没有行,SQL Server 如何返回 NULL 而不是 0
- vba - 将 Word 另存为 PDF - 后期装订
- c# - 在.Net中使用Linq解析XML,带有属性前缀值
- sql - Postgres中具有公共和私有ID的数据库表设计