loadYamlAsMap static method

Map<String, dynamic> loadYamlAsMap(
  1. String contents
)

Load a YAML string as a native (Dart) map. Returns an empty map if the YAML is invalid.

Implementation

static Map<String, dynamic> loadYamlAsMap(String contents) {
  final map = loadYaml(contents);
  if (map is YamlMap) {
    return yamlMapToMap(map);
  }
  return {};
}