var data = List();
snapshot.data.documents.forEach((doc) => data.add(doc.data)); //my example data is one doc
data.add({"x": "y"}); //works
data[0]["bar"].add({"foo": "bar"}); //doesn't
My data looks like this:
data = [
{
"foo": "",
"bar": [
{"foo": "bar"},
{"foo": "bar"},
{"foo": "bar"},
],
},
];
When I do the second array modification, it gives me this error:
Unhandled Exception: Unsupported operation: Cannot add to a fixed-length list
I have tried doing this with normal data that is not fetched from firebase, and it works as expected. I also tried using List.from to populate the array but it didn't work either.