map2Json function
返回json格式的String
Implementation
String map2Json(Map? map) {
if (map == null) {
return '';
}
StringBuffer sb = StringBuffer();
sb.writeln('{');
map.forEach((key, value) => sb.writeln('$key:$value'));
sb.write('}');
return sb.toString();
}