asTreeOfKeyString function
Maps tree
:
Implementation
dynamic asTreeOfKeyString(Object? tree) {
if (tree == null) return null;
if (tree is Map) {
return Map<String, dynamic>.fromEntries(tree.entries.map((e) {
return MapEntry<String, dynamic>('${e.key}', asTreeOfKeyString(e.value));
}));
} else if (tree is List) {
return tree.map(asTreeOfKeyString).toList();
} else {
return tree;
}
}