constraintAllows method
Check if a target version would satisfy the given constraint.
Useful for checking if a pubspec.yaml constraint needs updating.
Implementation
bool constraintAllows(String constraint, String version) {
try {
return VersionConstraint.parse(constraint)
.allows(Version.parse(version));
} catch (_) {
return false;
}
}