config/config_reader library

Classes

ConfigReader
Typed access to a YAML mapping, with errors that name the file, the position, and the key path.
ConfigWarning
A deprecation or other non-fatal note about a config file.
SourceSpanLike
The parts of a YAML span that error messages need.

Functions

closestMatch(String input, Iterable<String> options) → String?
The candidate in options closest to input, when close enough to be a likely typo.
describe(Object? value) → String
A short description of a YAML value's type for error messages.
displayPath(String path) → String
path relative to the current directory when that is shorter and does not climb more than one level.
loadConfigMap(String content, {required String file}) → YamlMap
Loads content as a YAML mapping. Throws a ConfigException when it is invalid YAML, empty, or not a mapping.
toPlain(Object? value) → Object?
Converts a YAML value into plain Dart maps, lists, and scalars, so it can be written back with yaml_edit.

Exceptions / Errors

ConfigException
A problem in a dpk config file, with the position of the offending node.