[flutter_tools] No more implicit --no-sound-null-safety (#118491)

* remove implicit no-sound-null-safety

* add test

* bump sdk constraint in test file
This commit is contained in:
Christopher Fujino
2023-01-18 12:46:09 -08:00
committed by GitHub
parent 8a58ec5c32
commit 374f09e1a6
4 changed files with 32 additions and 7 deletions

View File

@@ -1093,7 +1093,11 @@ abstract class FlutterCommand extends Command<void> {
(languageVersion.major == nullSafeVersion.major && languageVersion.minor >= nullSafeVersion.minor)) {
nullSafetyMode = NullSafetyMode.sound;
} else {
nullSafetyMode = NullSafetyMode.unsound;
throwToolExit(
'This application does not support sound null-safety (its language version is $languageVersion).\n'
'To build this application, you must provide the CLI flag --no-sound-null-safety. Dart 3 will only '
'support sound null safety, see https://dart.dev/null-safety.',
);
}
} else if (!wasNullSafetyFlagParsed) {
// This mode is only used for commands which do not build a single target like