Flutter for Beginners
上QQ阅读APP看书,第一时间看更新

Dart development tools

DartPad is a perfect way to start experimenting with the language without any extra effort. Since you will soon want to learn advanced things such as writing on files or using custom libraries, you'll need to have a development environment configured for that.

Flutter is based on Dart and you can develop Dart code by having a Flutter development environment. To find out how to configure a Flutter development environment,  just refer to the official website for the installation tutorial ( https://dart.dev/tools/sdk#install) .

The most common IDEs used for Dart and Flutter development are Visual Studio Code or VS Code (for the web and Flutter) and Android Studio or any JetBrains IDE such as WebStorm (which is web-focused). All of the Dart functionalities of these IDEs are based on official tools, so it doesn't matter what you choose—the provided tools will be mostly the same. The Dart SDK provides specialized tools for each development ecosystem, such as web and server-side programming. 

The standalone Dart SDK ships with the following tools:

  • dart (https://dart.dev/tools/dart-vm): This is the standalone Dart VM; this executes Dart code. To execute a Dart script, run the following command: 
dart code.dart
Lint, or a linter, is a tool that analyzes source code to flag errors, bugs, stylistic errors, and suspicious constructs.

For web development, Dart adds some tools (with additional installations steps at https://dart.dev/tools):

dart2js is also a web-focused tool, although it ships with the standard SDK. For server-side development, the standard SDK tools are the only ones we need.

All of the IDE plugins use these tools behind the scenes, so you can take advantage of the full toolset for Dart development.