add method
void
add({})
The rootPath
will be given to toUriStr
of toContent to produce
the corresponding file://
URI, normally a POSIX path.
The packageUri
is optional, a URI reference, resolved against the
file URI of the rootPath
. The result must be inside the rootPath
.
Implementation
void add({
required String name,
required String rootPath,
String packageUri = 'lib/',
String? languageVersion,
}) {
if (_packages.any((e) => e.name == name)) {
throw StateError('Already added: $name');
}
_packages.add(
_PackageDescription(
name: name,
rootPath: rootPath,
packageUri: packageUri,
languageVersion: languageVersion,
),
);
}