Skip to content

Add documentation for using 'dart-define' with Dart apps #3578

@nickmeinhold

Description

@nickmeinhold

I had trouble using dart-define after following https://dartcode.org/docs/using-dart-define-in-flutter/, not thinking about the fact that my app was a Dart app, not a Flutter app. I got it working in the end with a launch config like this:

{
  "name": "Dart",
  "request": "launch",
  "type": "dart",
  "program": "bin/dart_program.dart",
  "toolArgs": ["-Dkey=blah"]
}

The differences that matter (as I understand) are -D instead of dart-define and using "toolArgs" rather than "args". I think I understand why in both cases but I found that info with a fair bit of digging. I think it would be helpful to add some documentation for Dart apps like there is for Flutter.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    in docs / websiteRelates to documentation, including the Dart Code website

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions