copyMap function
The store always gives back an _InternalLinkedHasMap<dynamic, dynamic>
. This
creates a deep copy of the json and makes sure that the format is always
Map<String, dynamic>
.
Implementation
Map<String, dynamic> copyMap(Map map) {
final copy = Map<String, dynamic>.from(map);
for (final entry in copy.entries) {
copy[entry.key] = _castValue(entry.value);
}
return copy;
}