allowsAll method

Returns true if this constraint allows all the versions that other allows.

Implementation

@override
bool allowsAll(PackageVersionNumberGeneralLibraryConstraint other) {
  if (other.isEmpty) return true;
  if (other is PackageVersionNumberGeneralLibrary) return allows(other);

  if (other is PackageVersionNumberGeneralLibraryUnion) {
    return other.ranges.every(allowsAll);
  }

  if (other is PackageVersionNumberGeneralLibraryRange) {
    return !allowsLower(other, this) && !allowsHigher(other, this);
  }

  throw ArgumentError(
      'Unknown PackageVersionNumberGeneralLibraryConstraint type $other.');
}