Create and Run Dart Console Application Using VSCode?
To run a Dart console application:
- Install the Code Runner Extension
- Open the Dart code file in Text Editor, then use shortcut
Ctrl+Alt+N
, or right click the Text Editor and then clickRun Code
in context menu, the Dart console application will run and the output will be shown in the Output Window.
Steps to run in VS Code:
- Open Visual Studio Code.
- Close whatever folder you have open.
- Make sure you have Dart Code Extension installed, or install it if you don't have it.
Press Ctrl + Shift + P on Windows or Cmd + Shift + P on Mac
Select Dart: New Project
- Select Console Application
- Type in a name, example: hello_world
- Hit Enter
- Select a folder that already exists.
- Wait until it finishes
main.dart file will show up.
Hit Ctrl + F5 to run or Run, Run without debugging.
In the Debug Console window, you will see the result.
There is an easy way to create and run a Dart console application:
Open VSCode
Press cmd + shift + p on Mac or ctrl + shift + p on windows.
Choose Dart: New project
4.Then you should select Console Application
5.After locating console application everything is ready for you ð
Well, how to run it? So easy!!!ð
Just go to terminal and type: "dart main.dart"
or copy the main.dart path then type: "dart (paste main file path)"
or press ctrl + F5
That's it. I hope you enjoy. ð