I have a list of Map items. From this i want to modify a key value of an item by using it’s id. The below is the List of map.
List items = [{'id':'01','name':'Rahul'},{'id':'02','name':'John'},{'id':'03','name':'Marry'}];
From this list when i press a button i want to update the name of that item based on id.
For eg,
void editName(String id,String name){
//Here i want to edit the name based on that id
}
if i pass editName('02','Rose')
i want the result
[{'id':'01','name':'Rahul'},{'id':'02','name':'Rose'},{'id':'03','name':'Marry'}];
2
Answers
I Found the Solution :)