Dart is primarily used for Flutter app development. You can install the Flutter SDK or other IDEs that come with Dart.
Or, you can install Dart as a standalone tool.
The official Dart download page:
On Ubuntu, for instance, you can do the following.
One time setup to add the Dart APT repository:
$ wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/dart.gpg $ echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
Then, you can install the Dart SDK as follows:
$ sudo apt install dart
It's always a good idea to do some minimum verification of any new tools. to make sure that the installations were successful:
$ dart --version Dart SDK version: 2.16.2 (stable) (Unknown timestamp) on "linux_x64"
$ dart --help A command-line utility for Dart development. Usage: dart <command|dart-file> [arguments] Global options: -h, --help Print this usage information. -v, --verbose Show additional command output. --version Print the Dart SDK version. --enable-analytics Enable analytics. --disable-analytics Disable analytics. Available commands: analyze Analyze Dart code in a directory. compile Compile Dart to various formats. create Create a new Dart project. devtools Open DevTools (optionally connecting to an existing application). doc Generate HTML API documentation from Dart documentation comments. fix Apply automated fixes to Dart source code. format Idiomatically format Dart source code. migrate Perform null safety migration on a project. pub Work with packages. run Run a Dart program. test Run tests for a project. Run "dart help <command>" for more information about a command. See https://dart.dev/tools/dart-tool for detailed documentation.
Now that we have a development environment set up, let's try creating a simple program.
- Next Step: Creating the first program in Dart