The below code is decoding the Json Data for which the console output is also shown and the json data is also shown. I am able to decode the data successfully as per the console output. I want the decoded json data to be stored in an array so that I can store it in firestore document as an array.
How should I do that? I know how to store data in firestore database, all I need to store the json data in an array. Please guide me
CODE
var parsedData = json.decode(state.successResponse);
List members = parsedData['members'];
members.forEach((member){
String name1 = member['firstName'];
print(name1);
});
JSON DATA
flutter: {
"members": [
{
"firstName": "Michael"
},
{
"firstName": "Jennifer"
},
{
"firstName": "Lisa"
}
]
}
CONSOLE OUTPUT
flutter:Michael
flutter:Jennifer
flutter:Lisa