目录

Contents

使用 IntelliJ 和 Android Studio 开发 Dart 应用

Dart 插件为类似 IntelliJ IDEA 和 Android Studio 这样 JetBrains 的 IDE 提供了 Dart 支持。IntelliJ IDEA 是一款优秀的 Java IDE,除此之外它还支持许多其它的语言和框架。Android Studio 是一款基于 IntelliJ IDEA 的 IDE,其常用作开发 Android 和 Flutter。

The Dart plugin adds Dart support to JetBrains IDEs such as IntelliJ IDEA and Android Studio. IntelliJ IDEA is an intelligent Java IDE with support for many other languages and frameworks. Android Studio is an IDE based on IntelliJ IDEA that’s used for Android and Flutter development.

不管你选择哪一款 JetBrains 的 IDE 用于 Dart 开发,本文所包含的资源都可以帮助你快速入门并在你需要时给你提供更多的信息。

Whichever JetBrains IDE you choose for Dart development, this page has resources to help you get started quickly and find more information when you need it.

入门

Getting started

如果你还没有 IDE 和 Dart SDK,请先下载。然后安装相应的 Dart 插件并配置 Dart SDK 的路径。

If you don’t already have the IDE and the Dart SDK, get them. Then install the Dart plugin and tell it where to find the Dart SDK.

下载 IDE

Downloading the IDE

如果你还没有一款 JetBrains 的 IDE,请先安装。

Install a JetBrains IDE if you don’t already have one.

下载 Dart SDK

Downloading the Dart SDK

如果你还没有 Dart SDK,请先安装。

If you don’t already have the Dart SDK, install it.

配置以支持 Dart 开发

Configuring Dart support

下面是配置以支持 Dart 开发的一种方式:

Here’s one way to configure Dart support:

  1. Start the IDE, and install the Dart plugin. To find the Dart plugin, from the Welcome screen choose Configure > Plugins, then click Install JetBrains plugin, and then search or scroll down until you find Dart. Once you've installed the Dart plugin, restart the IDE. 启动 IDE 并安装 Dart 插件。你可以从欢迎界面窗口的 Configure > Plugins 菜单进入到插件设置界面,然后点击 Install JetBrains plugin 并搜索或拖动滚动条直到你找到 Dart。安装好 Dart 插件后记得重启 IDE。

  2. Create a new Dart project: 创建新的 Dart 项目:

    1. From the Welcome screen, click Create New Project.
    2. 在欢迎窗口界面点击 Create New Project
    3. In the next dialog, click Dart.
    4. 在接下来的对话框中点击 Dart

  3. If you don't see a value for the Dart SDK path, enter it. 如果 Dart SDK 路径为空请先设置。

    For example, the SDK path might be <dart installation directory>/dart/dart-sdk. 例如,SDK 的路径可能是 <Dart 安装目录>/dart/dart-sdk.

如果你已经创建过 Dart 项目,则可以在第二步的时候选择打开该项目,然后选择打开 pubspec.yaml 或其它 Dart 文件。

An alternative to Step 2 is to open an existing Dart project, and then open its pubspec.yaml file or any of its Dart files.

上报问题

Reporting issues

Please report issues and feedback via the official JetBrains issue tracker for Dart. Include details of the expected behavior, the actual behavior, and screenshots if appropriate.

更多信息

More information

你可以查看 JetBrains 网站获取更多的信息。

See the JetBrains website for more information.