这在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/