Windows11でDart開発環境をインストールする方法

環境
エディション Windows 11 Pro
バージョン 21H2
システムの種類 64bit

操作方法
1.Chocoleteyインストール
(1).「スタート」を右クリックし「Windows ターミナル(管理者) 」をクリックします。
(2).ユーザーアカウント制御画面が表示されます。
「はい」を選択します。
(3).管理者権限で「powershell」を起動します。

(4).以下のコマンドを実行します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

(5).バージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
> choco --version
1.1.0
> choco --version 1.1.0
> choco --version
1.1.0

2.Dart-sdkインストール

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
> choco install dart-sdk
Chocolatey v1.1.0
Installing the following packages:
dart-sdk
Enjoy using Chocolatey? Explore more amazing features to take your
experience to the next level at
https://chocolatey.org/compare
> choco install dart-sdk Chocolatey v1.1.0 Installing the following packages: dart-sdk 略 Enjoy using Chocolatey? Explore more amazing features to take your experience to the next level at https://chocolatey.org/compare
> choco install dart-sdk
Chocolatey v1.1.0
Installing the following packages:
dart-sdk
略
Enjoy using Chocolatey? Explore more amazing features to take your
experience to the next level at
https://chocolatey.org/compare

3.動作確認
「C:\study\dart\test.dart」に以下のコードを記載します.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
void main() {
print("hello world,study dart skill");
}
void main() { print("hello world,study dart skill"); }
void main() {
print("hello world,study dart skill");
}

ファイルを実行します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
PS C:\study\dart> dart test.dart
hello world,study dart skill
PS C:\study\dart> dart test.dart hello world,study dart skill
PS C:\study\dart> dart test.dart
hello world,study dart skill

 

Dart

Posted by arkgame