这在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]);
}
答案 0 :(得分:1)
请尝试如下
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]);
}