mergeMaps method
Utility method to merge two Maps.
Implementation
void mergeMaps(Map map1, Map map2) {
for (var key in map2.keys) {
var map1Value = map1[key];
var map2Value = map2[key];
if (map2Value is Map) {
if (map1Value == null) {
map1Value = {};
map1[key] = map1Value;
}
mergeMaps(map1Value, map2Value);
} else if (map1Value == null) {
map1[key] = map2Value;
}
}
}