json2yaml function
From Package: https://github.com/alexei-sintotski/json2yaml https://github.com/alexei-sintotski/json2yaml/blob/master/lib/src/json2yaml.dart Converts JSON to YAML representation
Implementation
/// Converts JSON to YAML representation
String json2yaml(
Map<String, dynamic> json, {
YamlStyle yamlStyle = YamlStyle.generic,
}) =>
_renderToYaml(json, 0, yamlStyle)
/// to make the formatting cleaner with fewer blank lines
.replaceAll(RegExp(r'(?<=\n\s*)\-\s\s*'), '- ');