Some things can be done more easily on the command-line, or are simply not (yet) included in Dart Editor. These tools are found in dart-sdk/bin
. They consist of the following:
-- version
option such as dart --version
with a typical output of Dart VM version: 1.3.0 (Tue Apr 08 09:06:23 2014) on "windows_ia32".dart –v –h
option lists and discusses all the possible options of the VM. Many tools also take the --package_root=<path>
or –p=<path>
option to indicate where the packages used in the imports reside on the filesystem.dartanalyzer prorabbits.dart
with output:Analyzing prorabbits.dart...
No issues found (or possibly errors and hints to improve the code)
test_pub
). To fetch packages (for example, for the test_pub
app), use the following command in the folder where pubspec.yaml
lives, pub get
, with a typical output as follows:Resolving dependencies... (6.6s) Got dependencies!
package
cache on your machine. The latest versions are downloaded and the package versions are registered in the pubspec.lock
file, so that your app can only use these versions.pub upgrade
command. You can use the –v
and -- trace
options to produce a detailed output to verify its workings.dartfmt
tool is also a built in Dart Editor. Right-click on any Dart file and choose Format from the context menu. This applies transformations to the code so that it conforms to the Dart Style Guide, which can be seen at https://www.dartlang.org/articles/style-guide/.You can also use it from the command line, but then the default operation mode is cleaning up whitespace. Use the –t
option to apply code transforms such as dartfmt -t –w bank_terminal.dart
.pub get
failspub build
)