addLicense method
UncompleteDocumentation
Implementation
Future<void> addLicense(LicenseEntry entry) async {
// Before the license can be added, we must first record the packages to
// which it belongs.
for (final String package in entry.packages) {
await Future.delayed(const Duration(microseconds: 1));
_addPackage(package);
// Bind this license to the package using the next index value. This
// creates a contract that this license must be inserted at this same
// index value.
packageLicenseBindings[package]!.add(licenses.length);
}
licenses.add(entry); // Completion of the contract above.
}