clearType function
Implementation
void clearType(Map<String, dynamic> map) {
map.removeWhere((key, _) => key == '__type');
map.values.whereType<Map<String, dynamic>>().forEach(clearType);
map.values
.whereType<List>()
.forEach((l) => l.whereType<Map<String, dynamic>>().forEach(clearType));
}