The programming language Dart is not exactly new. So you may ask yourself, why I am writing about it right now. Partly that is because I am going to talk about Dart at OOP 2017 in Munich and I want to advertise it a little. Partly that is because I finished updating my Android book, so I have some time to spare. Well, and partly that is …just because…
In a couple of short posts I will show you how Java devs can make themselves familiar with Dart. Let us start with the development environment. IntelliJ IDEA has gained widespread attention of Java devs throughout the years. It's the IDE of choice for many of us, so why not write Dart programs using it? The first step is to download and install the plugin.
Once the plugin is installed, we can begin creating a Dart project.
As you can see, two things are missing: Dartium and the Dart SDK. You can get both from https://www.dartlang.org/tools/sdk. The components can either be installed using platform-specific package managers, or manually. I just downloaded the .zip files and unpacked them in /opt. After I inserted the base directories of both Dartium and the Dart SDK, the project wizard looks like this:
As you can see, we can now choose from a couple of project templates. Dartium, by the way, is a Chromium derivate with Dart built in. More on that later… As I would like to start from scratch, I unchecked Generate sample content. The final page of the project wizard then looks like this:
This gives us an empty project, so I now need to create a file, for example Demo.dart. Once I have entered the typical hello world stuff, the IDE looks like this. The program can be executed from the menu bar.
First contact… having been made.
Edited 2017/01/03: Replaced a screenshot where the path to Dartium was wrong