Reputation: 355
This would work fine in JS, but Dart (Flutter) is having a heart attack. Any idea why ??
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]);
}
Upvotes: 0
Views: 239
Reputation: 7492
Please try like below
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]);
}
Upvotes: 1