Dart Code
Dart & Flutter support for Visual Studio Code Discord Chat Follow on Twitter Contribute to Dart Code

Using --dart-define in Flutter

You can pass additional --dart-define values to Flutter by specifying them in the toolArgs field of your launch configuration (launch.json):

"configurations": [
		"name": "Flutter",
		"request": "launch",
		"type": "dart",
		"toolArgs": [

Using the example above, you can print MY_VALUE and MY_OTHER_VALUE by using the String.fromEnvironment constructor:

print(const String.fromEnvironment('MY_VAR'));
print(const String.fromEnvironment('MY_OTHER_VAR'));

For Dart apps, you should use --define.