Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Map keys by values in Dart?

In Dart language how to get MAP keys by values?

I have a Map like;

{   "01": "USD",   "17": "GBP",   "33": "EUR" } 

And I need to use values to get keys. How do I do that?

like image 776
Nick Avatar asked Aug 28 '18 07:08

Nick


Video Answer


1 Answers

var usdKey = curr.keys.firstWhere(     (k) => curr[k] == 'USD', orElse: () => null); 
like image 61
Günter Zöchbauer Avatar answered Oct 05 '22 22:10

Günter Zöchbauer