I have a list of map and I want to get the map of specific key
for example :
video of letter a
List<Map<String, String>> letters = const [
{
'letter': 'a',
'name' : 'ddd',
'video' : 'ss',
},
{
'letter': 'b',
'name' : 'ddd',
'video' : 'ss',
},
{
'letter': 'c,
'name' : 'ddd',
'video' : 'ss',
},
]
>Solution :
I guess you can use .where method like this
List listWithVideo = letters.where((element) => element['letter'] == 'a').toList();
Now here you will get list of maps where you will find your letter a.
If you want to get only one map or the first map that has the same, you can also use firstWhere method.