Reputation: 316
how can I access to a particular item in a List <Map>
with Dart?..
Doing an analogy with JS it's would be something like arrayObject[0].atribObject
... Example
I need to show the value of name
atrib from 2nd object
List<Map> arrayObjects = [{"name":"Map1"},{"name":"Map2"}];
Upvotes: 2
Views: 172
Reputation: 1141
Well since it's a list of maps the correct syntax would be:
List<Map> arrayObjects = [{"name":"Map1"},{"name":"Map2"}];
print(arrayObjects[1]["name"]);
Upvotes: 2