BuildConfig.parse constructor
BuildConfig.parse(})
Create a BuildConfig by parsing configYaml
.
If configYamlPath
is passed, it's used as the URL from which
configYaml
for error reporting.
Implementation
factory BuildConfig.parse(
String packageName,
Iterable<String> dependencies,
String configYaml, {
String? configYamlPath,
}) {
try {
return checkedYamlDecode(
configYaml,
(map) =>
BuildConfig.fromMap(packageName, dependencies, map ?? const {}),
allowNull: true,
sourceUrl: configYamlPath == null ? null : Uri.file(configYamlPath),
);
} on ParsedYamlException catch (e) {
throw ArgumentError(e.formattedMessage);
}
}