Is there any kind of collection to declare a map with multiple keys linked to the very same value ?
I want the map to be initialized at the same time that it is declared. Ideally something like:
MyMap<String, String> mymap = {['red', 'blue', 'green'] : 'Rock', ['pink', 'yellow' ...etc}
So far I found Multimap in the documentation but it seems that its one key for multiple value, and on top of that I have a lot of trouble for implementing since that despite the documentation there is 0 example given.
Here my try so far:
static Iterable mylist = ['red', 'blue', 'green']; // I want to associate these strings to 'Rock'
static Iterable mylist = ['pink', 'yellow', 'cyan']; // I want to associate these strings to 'Funk'
static Multimap<String,String> okayboomer = Multimap.fromIterable(mylist);//, {K key(dynamic element), V value(dynamic element)});
And then whenever I access okayboomer['red'] I would get 'Rock'.
I was also thinking about HashMap
Any help strongly appreciated!