Fix language version check logic to determine nullsafe soundness. (#116679)

This commit is contained in:
Siva 2022-12-07 12:51:56 -08:00 committed by GitHub
parent 3f1fb1b960
commit 8b80552a3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1089,7 +1089,8 @@ abstract class FlutterCommand extends Command<void> {
);
// Extra frontend options are only provided if explicitly
// requested.
if (languageVersion.major >= nullSafeVersion.major && languageVersion.minor >= nullSafeVersion.minor) {
if ((languageVersion.major > nullSafeVersion.major) ||
(languageVersion.major == nullSafeVersion.major && languageVersion.minor >= nullSafeVersion.minor)) {
nullSafetyMode = NullSafetyMode.sound;
} else {
nullSafetyMode = NullSafetyMode.unsound;