Phenomenon
Before VSCode, the project could run, but after upgrading to Flutter 3.10.0 and Dart 3.0, it suddenly failed to start, and the command line operation flutter run
is possible.
The error is as follows:
reason
As we all know, it was removed in Flutter 3.10.0 no-sound-null-safety
, forcing global empty security. Flutter 3.10.0 release notes
So how can VSCode still run the project?
solution
- VSCode Click the gear icon in the lower left corner, command panel;
- Enter settings.json ;
--no-sound-null-safety
Removed parameter fromdart.flutterAdditionalArgs
.
expand
At the same time, in the search project sound-null-safety
, no-sound-null-safety
the places with and parameters need to be deleted.