How to add --no-sound-null-safety on a single run/debug on vscode (Flutter)?

Viewed 8366

On vscode, when try run or debug using "Run" or "Debug" button, the runner doesn't add --no-sound-null-safety argument.

How to configure vscode to add --no-sound-null-safety argument?

enter image description here

enter image description here

4 Answers

If using vscode. create .vscode/launch.json in project root and add

"args": [
     "--no-sound-null-safety"
    ]

complete code :-

    "version": "0.2.0",
    "configurations": [
            {
                    "name": "YOUR_PROJECT_NAME",
                    "program": "lib/main.dart",
                    "request": "launch",
                    "type": "dart",
                    "args": [
                            "--no-sound-null-safety"
                        ]
            }
    ]

}`

I added these items to the settings.json file.

{
    "dart.flutterTestAdditionalArgs": ["--no-sound-null-safety"],
    "dart.flutterAdditionalArgs": ["--no-sound-null-safety"],
    "dart.vmAdditionalArgs": ["--no-sound-null-safety"]
}

For IDE run arguments/configuration

Search for "Flutter run additional args" in your user settings and add --no-sound-null-safety . Paste the command in the item field and click ok as we already added one command.

enter image description here

For Test configuration

Search for "Flutter test additional args" in your user settings and add --no-sound-null-safety . Do the same process as on the above picture and add this command.

after all, you will be able to run unsound null or hybrid apps with debug button

follow these instruction
Goto:

File -> Preferences -> Settings 

Then search:

Flutter run additional args

Then Add new arg like this

--no-sound-null-safety

Then simply run
Also can follow image Go here

then do this enter image description here

Related