void main() {
List users = [
{"id": 1, "name": "mike", "code": "01"},
{"id": 2, "name": "jack", "code": "02"}
];
}
How do I print the id key for example or name.
CodePudding user response:
Loop the list
to get access to every child Map
. Then you can print any thing you want.
void main() {
var original = [
{"id": 1, "name": "mike", "code": "01"},
{"id": 2, "name": "jack", "code": "02"}
];
original.forEach((map) {
print('id: ${map['id']}');
print('name: ${map['name']}');
});
}