encodeMaps static method
Convert Symbol maps to String maps
For example, {Symbol('name'): 'John'} becomes {'name': 'John'}
obj is the map to be converted.
Returns a new map with String keys.
Implementation
static Map encodeMaps(Map obj) {
var res = {};
for (Object o in obj.keys) {
var key = "";
if (o is Symbol) {
key = symbolToKey(o);
} else {
key = o.toString();
}
res[key] = obj[o];
}
return res;
}