How to run Dart code on Google Cloud IDE

Step to run Dart code on Google Cloud Editor

How to run Dart code on Google Cloud IDE

Below is the step to run Dart code on Google Cloud editor. Google Cloud editor has multiple alias names. Some of the names are Google Cloud Shell shell or IDE.

Step

  • Sign in to Google Cloud Account.
  • Open Google Cloud IDE using the link below.

Link: ide.cloud.google.com

  • Click File > Open menu to open directory / folder.
  • Click File > “New File” menu to create a new file.
  • Type file name as “hello-word.dart”.
  • Type dart code in the “hello-word.dart” file.

Sample code: github.com/manikandank276/blog/blob/main/da..

  • Click Terminal > “New Terminal” menu to open terminal if not opened.
  • Run the below command to configure Google Cloud project using below command.

Command: gcloud config set project <google-cloud-project-id>

  • Click on the “AUTHORIZE” button in the “Authorize Cloud Shell” screen.
  • Run the below command to go to the directory which contains the dart file.

Command: cd <directory>

  • Run the below command to execute the dart file.

Command: dart hello-word.dart

  • Dart and Flutter SDK downloads and installs automatically.
  • Code output displays in the terminal.

Screenshot

Google Cloud Editor