I'm trying to insert an object into array of objects. The idea is just add the content of the object if the object already exist but I don't understand why I can't use the .insert
I have tried using the .insert and adding the object into the array.
void main() {
var arr = [
{
"shelf1": [
{
"Entry": "something",
"Status": "",
"Account": "",
"Address": "",
"Result": null
}
]
},
{
"shelf2": [
{
"Entry": "something",
"Status": "",
"Account": "",
"Address": "",
"Result": null
}
]
},
{
"shelf3": [
{
"Entry": "something",
"Status": "",
"Account": "",
"Address": "",
"Result": null
}
]
}
];
var object = {
"shelf1": {
"Entry": "something2",
"Status": "",
"Account": "",
"Address": "",
"Result": null
}
};
arr.insert(0, object);
print(arr);
}