首页 > 解决方案 > Flutter FilterChip _cast 列表从端点动态加载

问题描述

我在这里找到的示例中使用示例代码:https ://docs.flutter.io/flutter/material/FilterChip-class.html

在示例代码中,_cast是一个final列表。

要使_cast列表由来自端点的列表响应填充,需要进行哪些更改?

我做了什么?

我尝试过使用FutureBuilder,但无论出于何种未知原因,返回的都不会作为快照future传递。builder

https://gist.github.com/seanmavley/0a5f5190272c4f1a60b5a47203a06746

标签: dartflutter

解决方案


尝试以下代码

List<ActorFilterEntry> _castList;
  loadInterest() async {
    ...
    setState(() {
      _castEntry = res['interest'];
    });
  }

推荐阅读