The way to create a HashMap with a custom equality function (and the corresponding hashCode custom function) is to use the optional parameters in the HashMap constructor:
new HashMap<String,Whatever>(equals: (a, b) => a.toUpperCase() == b.toUpperCase(), hashCode: (a) => a.toUpperCase().hashCode);
I really recommend finding a way to not do toUpperCase with every operation!
source share