You would need to have the latest version of VS Code.
Then add the block below to your launch.json file and put it inside the .vscode folder in your app’s root directory.
{
"name": "flavor-prod",
"request": "launch",
"type": "dart",
"program": "lib/main_prod.dart",
"args": [
"--flavor",
"prod",
]
},
Development: flutter run --flavor dev -t lib/main_dev.dart
Staging: flutter run --flavor stag -t lib/main_stag.dart
Production: flutter run --flavor prod -t lib/main_prod.dart