saveFileYaml static method

void saveFileYaml(
  1. String path,
  2. Map map
)

Saves data to a YAML file.

This method converts a Map to YAML format and writes it to a file.

Parameters:

  • path: The path where the YAML file should be saved
  • map: The Map containing the data to be saved as YAML

Example:

final config = {
  'app_name': 'My App',
  'version': '1.0.0',
};
YamlHelper.saveFileYaml('./morpheme.yaml', config);

Implementation

static void saveFileYaml(String path, Map map) {
  final yaml = YamlWriter().write(map);
  path.write(yaml);
}