Show us a basic Dart program?

The following code uses many of Dart’s most basic features:

// Define a function.
void printInteger(int aNumber) {
print(‘The number is $aNumber.’); // Print to console.

// This is where the app starts executing.
void main() {
var number = 42; // Declare and initialize a variable.
printInteger(number); // Call a function.

Here’s what this program uses that applies to all (or almost all) Dart apps:

// This is a comment.
A single-line comment. Dart also supports multi-line and document comments. For details, see Comments.
A special type that indicates a value that’s never used. Functions like printInteger() and main() that don’t explicitly return a value have the void return type.
Another type, indicating an integer. Some additional built-in types are StringList, and bool.
A number literal. Number literals are a kind of compile-time constant.
A handy way to display output.
'...' (or "...")
A string literal.
$variableName (or ${expression})
String interpolation: including a variable or expression’s string equivalent inside of a string literal. For more information, see Strings.
The special, required, top-level function where app execution starts. For more information, see The main() function.
A way to declare a variable without specifying its type. The type of this variable (int) is determined by its initial value (42).