【发布时间】:2017-12-20 04:32:04
【问题描述】:
如何向flutter Card Widgets 提供 JSON 信息,就像在 Swift 中使用 tableView 控制器一样;这是为各种数组提供标题、图像、描述,例如并索引每个项目?
**** 使用 JSON 解码代码更新
var httpClient = createHttpClient();
var response = await httpClient.read(url);
String data = JSON.decode(response);
Map items = JSON.decode(data);
Map<String, dynamic> decoded = new JsonCodec().decode(data);
for (String key in decoded.keys) {
print("Key $key contains: ${decoded[key]}");
我已经添加了上面的代码,现在我收到了这个错误。请提供有关如何修复的任何想法。顺便说一句...这是来自 YouTube ResponseList
type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'String' of 'data' where
_InternalLinkedHashMap is from dart:collection
String is from dart:core
String is from dart:core
【问题讨论】:
标签: arrays json widget flutter