Cài đặt Dart SDK trên Windows
Xem thêm các chuyên mục:
.
- TODO Link!
Google cung cấp 3 kênh để bạn download Dart, tùy thuộc vào mục đích của bạn.
Stable Channel
Stable Channel cho phép bạn download phiên bản Dart ổn định ở cấp độ sản phẩm, bạn có thể sử dụng nó mà không phải lo lắng về các lỗi (bugs) trong mã.
Beta Channel
Beta Channel cho phép bạn download phiên bản Dart với các tính năng mới nhất, nhưng chưa chính thức được phát hành bởi vì nó cần thêm thời gian để kiểm tra thêm về tính ổn định. Bạn có thể download phiên bản này nếu bạn muốn tìm hiểu trước các tính năng mới.
Dev Channel
Dev Channel cho phép bạn download phiên bản Dart với tất cả các tính năng đang được phát triển bới đội ngũ thiết kế Dart. Đây là phiên bản thay đổi liên tục và không ổn định.
Để download Dart bạn truy cập vào đường dẫn dưới đây.

Sau khi download thành công bạn sẽ có được một file zip.
Giải nén file zip mà bạn đã download được ở bước trên. Chẳng hạn, giải nén ra thư mục C:/dart-sdk:

Mở thư mục bin của dart-sdk trên Windows Explorer. Nhập vào từ khóa "CMD" trên thanh địa chỉ và nhấn Enter, một cửa sổ CMD sẽ được mở ra.

Nhập vào "dart" trên cửa sổ CMD và nhấn Enter, bạn sẽ nhận được danh sách các đối số (arguments) của lệnh "dart" và cách sử dụng của chúng.

C:\dart-sdk\bin>dart Usage: dart [<vm-flags>] <dart-script-file> [<script-arguments>] Executes the Dart script <dart-script-file> with the given list of <script-arguments>. Common VM flags: --enable-asserts Enable assert statements. --help or -h Display this message (add -v or --verbose for information about all VM options). --packages=<path> Where to find a package spec file. --observe[=<port>[/<bind-address>]] The observe flag is a convenience flag used to run a program with a set of options which are often useful for debugging under Observatory. These options are currently: --enable-vm-service[=<port>[/<bind-address>]] --pause-isolates-on-exit --pause-isolates-on-unhandled-exceptions --warn-on-pause-with-no-debugger This set is subject to change. Please see these options (--help --verbose) for further documentation. --write-service-info=<file_uri> Outputs information necessary to connect to the VM service to the specified file in JSON format. Useful for clients which are unable to listen to stdout for the Observatory listening message. --snapshot-kind=<snapshot_kind> --snapshot=<file_name> These snapshot options are used to generate a snapshot of the loaded Dart script: <snapshot-kind> controls the kind of snapshot, it could be kernel(default) or app-jit <file_name> specifies the file into which the snapshot is written --version Print the SDK version.
Bạn cũng cần thêm đường dẫn của Dart vào biến môi trường (Environment Variable), điều này là cần thiết để bạn có thể sử dụng Dart SDK từ bất kỳ nơi nào trên máy tính của bạn.
Nhấn WIN + R để mở ra cửa sổ RUN.

Nhập vào lệnh dưới đây để mở ra cửa sổ Environment Variables:
rundll32.exe sysdm.cpl,EditEnvironmentVariables

Lựa chọn biến "Path" và nhấn vào nút "Edit":


Lúc này bạn có thể sử dụng lệnh "dart" từ bất kỳ thư mục nào trên máy tính của bạn.
Chú ý: Có thể bạn cần khởi động lại máy tính để các thay đổi có tác dụng.
