- Dart:Scalable Application Development
- Davy Mitchell Sergey Akopkokhyants Ivo Balbaert
- 879字
- 2021-07-09 18:56:14
Downloading the tools
Let's get started by installing a complete Dart development environment on your computer. The home of Dart on the Internet is https://www.dartlang.org, which contains the software, a wealth of documentation, and links to the online Dart community.
I would strongly recommend signing up for the e-mail lists on this site to keep up with Dart, and also the Dartisans Google+ community (http://g.co/dartisans). The number of daily messages can be overwhelming at first, but there are some great discussions and information sharing. It is also a great opportunity to interact with Dart's creators.
Tip
It is recommended that you use the Stable channel. This version updates roughly every few months via a built-in update tool. There is also a Dev (development) channel that updates once or twice a week with the very latest code from the Dart developers. This is great for seeing new features early, but it is not as polished or reliable as the Stable releases.
The downloads for all supported platforms (Linux, Mac, and Windows) are available at https://www.dartlang.org/tools/download.html. The same location provides information regarding building from source. Ensure that you download both the SDK and Dartium (a specialist browser).
It is recommended that Mac users use the Homebrew system to manage the installation and updates of Dart. Linux users can use a .deb
if that format is supported on their distribution, with ZIP archives being the alternative. Windows versions are also supplied as ZIP archives.
Windows users can download, install, and update the SDK and Dartium using the Chocolatey installation system that is built on nuget and Powershell.
Note
See http://chocolatey.org for more information.
The Dart packages are called dart-sdk
and dartium
.
Introducing the WebStorm IDE
WebStorm is the premiere development environment for Dart and was created by JetBrains, which also publishes IntelliJ IDEA for Java and ReSharper for .Net.
WebStorm is a commercial package available at https://www.jetbrains.com/. There are free licenses available for many and deep discounts for individuals. It supports a range of languages and development platforms and Dart support is provided via a plug-in. The plugin comes pre-installed with the IDE.
Download the installation file and follow the installation steps on screen:

WebStorm has a number of powerful features to help write our web applications:
- Auto-completion of code: properties and methods are listed as you type
- A static analyzer that scans as you type for possible problems
- Refactoring tools to help rename entities and extract methods
- Quick fixes to correct common errors easily
- Navigation via a code tree and finding usages of a function
- A code reformatter to keep the source code in a tidy format
- A powerful debugger
Alternative development environments
If you wish to use another IDE, there are plugins for IntelliJ IDEA and Eclipse. If you prefer a simple text editor, there are plugins for Sublime, Emacs, and Vim. These are all listed on the DartLang download page.
If you are an avid Visual Studio user, there is a community project underway to bring Dart to that environment. DartVS can be downloaded from the Visual Studio Gallery. It directly uses the DartAnalyzer from the SDK to report errors, warnings, and hints inside the IDE. Support for intellisense and other features is underway, too.
The Atom Editor (https://atom.io/) is an alternative for those who prefer a lightweight editor to a fully fledged development environment. The plugin, named dartlang
(https://atom.io/packages/dartlang) provides code-completion, syntax highlighting, and access to some pub
commands.
Help starting a project
To help create your new project, Dart has a tool called Stagehand that creates the scaffolding from a high quality project template of your choice. It takes care of common tasks such as folder structure, common libraries, and style sheets. It even has its own website (http://stagehand.pub/).
In WebStorm, creating a new project presents you with a range of powerful options, allowing you to set the locations of the Dart SDK and choose a project type for sample content. The project type gives a range of skeleton applications and is powered by the Stagehand application that is part of the SDK:

Stagehand
can also be run from the command line, with the first step being to install it as a command:
pub global activate stagehand
This step installs the stagehand
command from the stagehand
package:
mkdir aproject cd aproject stagehand web-full
This will create a folder of sample content based on the web-full template.
Elsewhere in the SDK
The download also includes a set of command-line tools, which can be found under the dart-sdk/bin path
.

Tip
You may wish to place these tools on the system PATH so that you can call them from anywhere on the command line. This is optional as WebStorm provides an easy interface to these tools; however, many developers find it essential to a good workflow.
For more detailed information on the installation and configuration of pub
, see
Also in this location is a snapshots folder. Most of the tools are written in Dart itself; when they are started up and initialized, a binary image of the initialized state can be stored and used for future executions of the program.
The snapshots are generated using the Dart executable and are mostly intended for frequently used command-line applications in deployment.
- Puppet 4 Essentials(Second Edition)
- Android 9 Development Cookbook(Third Edition)
- RTC程序設(shè)計(jì):實(shí)時音視頻權(quán)威指南
- Python王者歸來
- 精通網(wǎng)絡(luò)視頻核心開發(fā)技術(shù)
- Learning Python by Building Games
- 軟件測試技術(shù)指南
- C語言程序設(shè)計(jì)上機(jī)指導(dǎo)與習(xí)題解答(第2版)
- 基于Struts、Hibernate、Spring架構(gòu)的Web應(yīng)用開發(fā)
- Angular開發(fā)入門與實(shí)戰(zhàn)
- Python趣味編程與精彩實(shí)例
- 零基礎(chǔ)看圖學(xué)ScratchJr:少兒趣味編程(全彩大字版)
- Mastering Gephi Network Visualization
- 青少年學(xué)Python(第2冊)
- Java程序設(shè)計(jì)教程