question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support debug as console project in flutter project

See original GitHub issue

I have a flutter project, and now I want to test some dart grammar. I configure the launch.json but extension launch the code on web browser. It would be better to provider an option to let me debug code in dart console application environment.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "dart",
            "type": "dart",
            "request": "launch",
            "program": "${file}",
        }
   ]
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, Apr 21, 2021

Thanks for the clarification. I think using the bin folder makes most sense here - I don’t think it’s common to put executable scripts inside the lib folder of a Flutter project so I don’t think it’s worthwhile to change how the debugger is selected only for this purpose.

Another option is to create a sibling project alongside your Flutter app and open them both in VS Code together - scripts in a non-Flutter app would always run with the Dart VM.

Hope this makes sense!

0reactions
tjx666commented, Apr 20, 2021

Recently I am studying flutter in depth through some code test, and I both want to study dart grammar in both project. like bellow:

stateless widget life cycle

I configure the launch.json and so I can debug dart code as console app, but now I have to put code to bin folder.

stateless widget life cycle
Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging Flutter apps
DevTools · Setting breakpoints · The Dart analyzer · Logging · Debugging application layers · Debug mode assertions · Debugging animations · Measuring...
Read more >
Debugging Flutter apps programmatically
This doc describes debugging features that you can enable in code. For a full list of debugging and profiling tools, see the Debugging...
Read more >
Using the debugger - Flutter documentation
Console output for the running app (stdout and stderr) is displayed in the console, below the source code area. You can also see...
Read more >
Visual Studio Code - Flutter documentation
Start debugging by clicking Run > Start Debugging from the main IDE window, or press F5 . Selecting a target device. When a...
Read more >
Flutter's build modes
By default, flutter run compiles to debug mode. Your IDE supports this mode. Android Studio, for example, provides a Run > Debug… menu...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found