I have the following list:
List<Map> list = [{'id': 5, 'title': 'fdf', 'description': 'fdf'}];
Now, I want to access this list and retrieve, for example, the title value to store it in a variable.
How can I do that?
It is probably very simple, but I got confused.
You can access title's value like this:
if(list.isNotEmpty){
print("value = ${list.first["title"]}");
}
or if you list has multiple item you can access like this:
for (var item in list) {
print("value = ${item["title"]}");
}
and the result would be fdf
.