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

Yanwei Liu
1 min readJun 4, 2020

--

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.

--

--

No responses yet