如何在Visual Studio Code上編譯Dart程式?

1.下載SDK

https://dart.dev/tools/sdk/archive解壓縮到自己路徑後,新增<dart-sdk-path>\bin至Windows的環境變數當中。

2.驗證是否安裝成功

開啟命令提示字元(CMD)輸入dart檢查是否有跳出相關訊息

3.安裝Code Runner

新建立一個*.dart的文件後,使用VS Code開啟
在編輯器視窗當中->右鍵Run Code(或是使用快捷鍵Ctrl+Alt+N)
即可完成編譯並執行Dart
20200605更新:出現Cannot edit in read-only editor VS Code的問題Go to File > Preference > Settings thentype: run code and scroll down until you see code-runner: Run in terminal, There will be multiple options called “code-runner”. In that you can find the option mentioned below.just check “Whether to run code in integrated terminal” andrestart vscode.For Mac users, it is Code > Preference > Settings.

Written by

Machine Learning / Deep Learning / Python / Flutter cakeresume.com/yanwei-liu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store