Dart: 1.Dart development environment configuration

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/ssmark/article/details/102728511

A. Windows environment

1. Choco install Dart SDK

Recommended direct use chocoinstalled, on chocohow to use can refer https://chocolatey.org/

Official documents address: https: //dart.dev/get-dart#install-using-chocolatey

Install stable version:

choco install dart-sdk

Install development version:

choco install dart-sdk --pre

Upgrade dart version:

choco upgrade dart-sdk

2. Decompression Installation Configuration

To dart Chinese network to download, depending on the type of development specified SDK download
Here Insert Picture Description
unpacked directory structure
Here Insert Picture Description
configuration environment variable
Here Insert Picture Description

DARK_HOME=D:\dartsdk-windows-x64-release\dart-sdk
path变量中添加%DARK_HOME%\bin;

3. Install version

To Dart SDK installer for Windows official address to download Dark, select the corresponding type of system
Here Insert Picture Description
installed directly to the specified path
Here Insert Picture Description

4. Test whether the installation is successful

dart --version

Here Insert Picture Description

dart

Here Insert Picture Description

Two. Mac environment

brew install dart

Under OSX install dart through the brew is very convenient, if not installed brew, you can go http://brew.sh/

The official address of the document:

  • https://dart.dev/get-dart

Install stable version:

brew tap dart-lang/dart
brew install dart

Install development version:

brew install dart --devel

updated version:

brew upgrade dart

Switch Version:

brew switch dart 1.24.3
brew switch dart 2.1.0

Here Insert Picture Description

三 . IntelliJ IDEA

1. IntelliJ IDEA download and install

Dart has many common IDE plug-ins can be used. If you have not used the IDE, we're using IntelliJ IDEA , Dart install plug-ins to support development.

2. Install the plug-Dart

Settings -> Plugins -> Marketplace -> 搜索 Dart -> Install -> 重启IDE

Here Insert Picture Description

3. Create a project Dart

File -> New Project -> Select the Dart Project -> Configure Dart sdk path of
Here Insert Picture Description
the new general project directory structure
Here Insert Picture Description
to create a new Dart file in the project file Demo.dart

// 定义个方法。
printNumber(num aNumber) {
  print('The number is $aNumber.'); // 在控制台打印内容。
}

// 这是程序执行的入口。
main() {
  var number = 42; // 定义并初始化一个变量。
  printNumber(number); // 调用一个方法。
}

Run the test
Here Insert Picture Description
Welcome to sweep the two-dimensional surface following code concern " cosine plots " public micro signal
Here Insert Picture Description

In all things, hope and beauty

Guess you like

Origin blog.csdn.net/ssmark/article/details/102728511