FhirMarkdown.fromYaml constructor

FhirMarkdown.fromYaml(
  1. dynamic yaml
)

Implementation

factory FhirMarkdown.fromYaml(dynamic yaml) => yaml is String
    ? FhirMarkdown.fromJson(jsonDecode(jsonEncode(loadYaml(yaml))))
    : yaml is YamlMap
        ? FhirMarkdown.fromJson(jsonDecode(jsonEncode(yaml)))
        : throw YamlFormatException<FhirMarkdown>(
            'FormatException: "$json" is not a valid Yaml string or YamlMap.');