gpt4 book ai didi

flutter - flutter 朔迷离的嵌套列表与对象

转载 作者:行者123 更新时间:2023-12-03 04:56:19 25 4
gpt4 key购买 nike

这在JS中可以正常工作,但是Dart(Flutter)心脏病发作。知道为什么吗??

void main() {
var foo = [
{
"some": "thing", // comment this line and it works ??
"test": ["one", "two", "three"]
}
];

// The operator '[]' isn't defined for the class 'Object'
print(foo[0]["test"][0]);
}

最佳答案

请尝试如下

void main() {
List foo = [
{
"some": "thing", // comment this line and it works ??
"test": ["one", "two", "three"]
}
];

// The operator '[]' isn't defined for the class 'Object'
print(foo[0]["test"][0]);
}

关于flutter - flutter 朔迷离的嵌套列表与对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60585522/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com