addLicense method

void addLicense(
  1. LicenseEntry entry
)

Implementation

void addLicense(LicenseEntry entry) {
  // Before the license can be added, we must first record the packages to
  // which it belongs.
  for (final String package in entry.packages) {
    _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.
}