I have user list and map like below
user = [
{'user': 'John', 'id': 'aaa'},
{'user': 'Jane', 'id': 'aa1'},
];
I want to find Jane and change her id as 'aa3'. Currently, I am searching the index inside the user[]. And then use that index to update the value of id.
int i = user.indexWhere((e) => e.name == 'Jane');
user[i]['id'] = 'aa1';
Is there any way that I can do this at once? It seems very inefficient way to do it, but couldn't find the better way yet.