jsonToCsvSingle static method

String jsonToCsvSingle(
  1. String json
)

Implementation

static String jsonToCsvSingle(String json) {
  Map<String, dynamic> map = jsonDecode(json);
  StringBuffer csvData = StringBuffer();
  for (String key in map.keys) {
    csvData.write("$key,${map[key]}\n");
  }
  return csvData.toString();
}