Skip to content

feat: allow fixed flutter version constraints. #4578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/src/lock_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ class LockFile {
originalConstraint,
defaultUpperBoundConstraint: null,
),
'flutter' => SdkConstraint.interpretFlutterSdkConstraint(
originalConstraint,
),
_ => SdkConstraint(originalConstraint),
};
},
Expand Down
20 changes: 1 addition & 19 deletions lib/src/pubspec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,7 @@ environment:
_packageName,
_FileType.pubspec,
);
constraints[name] =
name == 'flutter'
? SdkConstraint.interpretFlutterSdkConstraint(constraint)
: SdkConstraint(constraint);
constraints[name] = SdkConstraint(constraint);
});
}
return constraints;
Expand Down Expand Up @@ -816,21 +813,6 @@ class SdkConstraint {
return SdkConstraint(constraint, originalConstraint: originalConstraint);
}

// Flutter constraints get special treatment, as Flutter won't be using
// semantic versioning to mark breaking releases. We simply ignore upper
// bounds.
factory SdkConstraint.interpretFlutterSdkConstraint(
VersionConstraint constraint,
) {
if (constraint is VersionRange) {
return SdkConstraint(
VersionRange(min: constraint.min, includeMin: constraint.includeMin),
originalConstraint: constraint,
);
}
return SdkConstraint(constraint);
}

/// The language version of a constraint is determined from how it is written.
LanguageVersion get languageVersion =>
LanguageVersion.fromSdkConstraint(originalConstraint);
Expand Down