Create dart first project app in vs code editor

Create dart first project app in vs code editor

I’m going to show you how to create a simple Dart example on Visual Studio Code and run it successfully. First and foremost, make sure that you have already installed the Dart Code Extension in Visual Studio Code, otherwise you can refer to the following article:

  • Cmd + Shift + P (Mac OS)
  • Ctrl + Shift + P (Windows)

 

Next, select “Console Application”:

import 'package:myfirstproject/myfirstproject.dart' as myfirstproject; 
  void main(List<String> arguments) { 
     print('Hello world: ${myfirstproject.calculate()}!'); 
}

To run the dart file, right-click it and select:

 

 

Leave a Reply